Skip to content

Commit

Permalink
feat(win32-def): add enums
Browse files Browse the repository at this point in the history
- INPUT
- KEYBDINPUT
- MOUSEINPUT
  • Loading branch information
waitingsong committed Jun 16, 2024
1 parent e574456 commit b5fdf54
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 3 deletions.
4 changes: 1 addition & 3 deletions packages/win32-def/src/index.consts.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@

export * from './lib/consts/wingdi.enum.js'
export * from './lib/consts/winspool.enum.js'
export * from './lib/consts/winuser.const.js'
export * from './lib/consts/index.consts.js'
export * from './lib/keyboard-mouse-input/virtual-key.consts.js'

8 changes: 8 additions & 0 deletions packages/win32-def/src/lib/consts/index.consts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

export * from './wingdi.enum.js'
export * from './winspool.enum.js'
export * from './winuser.const.js'
export * from './winuser-input.enum.js'
export * from './winuser-keybdinput.enum.js'
export * from './winuser-mouseinput.enum.js'

11 changes: 11 additions & 0 deletions packages/win32-def/src/lib/consts/winuser-input.enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

/**
* Used by SendInput to store information for synthesizing input events such as keystrokes, mouse movement, and mouse clicks.
* @link https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-input
*/
export enum INPUT {
INPUT_MOUSE = 0,
INPUT_KEYBOARD = 1,
INPUT_HARDWARE = 2,
}

12 changes: 12 additions & 0 deletions packages/win32-def/src/lib/consts/winuser-keybdinput.enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

/**
* A simulated keyboard event
* @link https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-keybdinput
*/
export enum KEYBDINPUT {
KEYEVENTF_EXTENDEDKEY = 0x0001,
KEYEVENTF_KEYUP = 0x0002,
KEYEVENTF_SCANCODE = 0x0008,
KEYEVENTF_UNICODE = 0x0004,
}

22 changes: 22 additions & 0 deletions packages/win32-def/src/lib/consts/winuser-mouseinput.enum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@

/**
* A simulated keyboard event
* @link https://learn.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-mouseinput
*/
export enum MOUSEINPUT {
MOUSEEVENTF_MOVE = 0x0001,
MOUSEEVENTF_LEFTDOWN = 0x0002,
MOUSEEVENTF_LEFTUP = 0x0004,
MOUSEEVENTF_RIGHTDOWN = 0x0008,
MOUSEEVENTF_RIGHTUP = 0x0010,
MOUSEEVENTF_MIDDLEDOWN = 0x0020,
MOUSEEVENTF_MIDDLEUP = 0x0040,
MOUSEEVENTF_XDOWN = 0x0080,
MOUSEEVENTF_XUP = 0x0100,
MOUSEEVENTF_WHEEL = 0x0800,
MOUSEEVENTF_HWHEEL = 0x1000,
MOUSEEVENTF_MOVE_NOCOALESCE = 0x2000,
MOUSEEVENTF_VIRTUALDESK = 0x4000,
MOUSEEVENTF_ABSOLUTE = 0x8000,
}

0 comments on commit b5fdf54

Please sign in to comment.