File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
src/common/protocol/input Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -34,15 +34,24 @@ export interface KeyModifiers {
3434export interface MouseEvent extends BaseInputEvent < 'mouse' > {
3535 /** Whether the button was pressed. */
3636 down : boolean ;
37+ /** Whether the mouse pointer was locked (e.g. to the frontend's canvas). */
38+ pointerLocked : boolean ;
3739 /** The mouse button. */
3840 button : 'left' | 'middle' | 'right' ; // TODO: Support more buttons
3941 /** The position. */
4042 pos : {
41- /** The x-coordinate in range 0-28. */
43+ /** The x-coordinate in terms of lighthouse columns, i.e. in the range 0-28. */
4244 x : number ;
43- /** The y-coordinate in range 0-14. */
45+ /** The y-coordinate in terms of lighthouse rows, i.e. in the range 0-14. */
4446 y : number ;
4547 } ;
48+ /** The movement of the mouse position. Useful e.g. for pointer-locked apps like games. */
49+ movement : {
50+ /** The movement on the x-axis. Expressed in terms of lighthouse columns, but may be negative. */
51+ x : number ;
52+ /** The movement on the y-axis. Expressed in terms of lighthouse rows, but may be negative. */
53+ y : number ;
54+ } ,
4655}
4756
4857/** Base type for gamepad/controller payloads. */
You can’t perform that action at this time.
0 commit comments