msgProc: Reference

Quick reference for msgProc constants, message types, and API functions. For concepts and examples, see the msgProc Guide.

Message Type Constants

All message types available in msgProc. Use these constants to identify which event occurred:

Constant Hex Value Description
MSG_UNKNOWN 0x0000 Unknown or unhandled event
MSG_SIZE 0x0005 Container changed size
MSG_SETFOCUS 0x0007 Element received focus
MSG_KILLFOCUS 0x0008 Element lost focus
MSG_KEYDOWN 0x0100 Key pressed down
MSG_KEYUP 0x0101 Key released
MSG_TIMER 0x0113 Timer elapsed
MSG_MOUSEMOVE 0x0200 Mouse moved
MSG_LBUTTONDOWN 0x0201 Left button pressed
MSG_LBUTTONUP 0x0202 Left button released
MSG_LBUTTONDBLCLK 0x0203 Left button double-clicked
MSG_RBUTTONDOWN 0x0204 Right button pressed
MSG_RBUTTONUP 0x0205 Right button released
MSG_MBUTTONDOWN 0x0207 Middle button pressed
MSG_MBUTTONUP 0x0208 Middle button released
MSG_MOUSEWHEEL 0x020A Mouse wheel changed
MSG_MOUSEENTER 0x020B Mouse entered the container
MSG_MOUSELEAVE 0x020C Mouse left the container
MSG_MOUSEENTER_DESCENDANT 0x020D Mouse entered a descendant element
MSG_MOUSELEAVE_DESCENDANT 0x020E Mouse left a descendant element
MSG_LCLICK 0x0210 Left-click completed (without drag)
MSG_MCLICK 0x0211 Middle-click completed (without drag)
MSG_RCLICK 0x0212 Right-click completed (without drag)
MSG_GESTURE 0x0250 Mouse gesture recognized
MSG_CHAR 0x0300 Printable character typed
MSG_CHANGE 0x0301 Input value changed (change event)
MSG_SUBMIT 0x0302 Form submitted
MSG_INPUT 0x0303 Text field about to change (paste, IME, etc.)
MSG_INPUT_COMPLETE 0x0304 Text field changed (paste, IME, etc.)
MSG_USER 0x1000 Base value for custom user-defined messages

Keyboard Event Types

WakaPAC provides different keyboard event types for different purposes:

Event When Fires wParam lParam Best For
MSG_KEYDOWN Key pressed down VK code Modifier keys (KM_*) Keyboard shortcuts, game controls, navigation
MSG_KEYUP Key released VK code Modifier keys (KM_*) Detecting key release, toggle states
MSG_CHAR Printable character typed Character code (UTF-16) Unused (0) Character filtering, custom input handling
MSG_INPUT Text field changed Length of inserted/changed text Unused (0) Validation, paste/autocomplete detection

Modifier Key Constants

Mouse Event Modifiers (MK_*)

Used in wParam for mouse events. Use bitwise AND to check which modifiers are held:

Constant Hex Value Description
MK_LBUTTON 0x0001 Left mouse button is down
MK_RBUTTON 0x0002 Right mouse button is down
MK_MBUTTON 0x0004 Middle mouse button is down
MK_SHIFT 0x0008 Shift key is down
MK_CONTROL 0x0010 Ctrl key is down
MK_ALT 0x0020 Alt key is down

Keyboard Event Modifiers (KM_*)

Used in lParam for keyboard events. Use bitwise AND to check which modifiers are held:

Constant Hex Value Description
KM_SHIFT 0x02000000 Shift key is down
KM_CONTROL 0x04000000 Ctrl key is down
KM_ALT 0x20000000 Alt key is down

Virtual Key (VK) Codes

Complete reference of Win32 Virtual Key codes exported by WakaPAC. All codes are available as wakaPAC.VK_* constants.

Control Keys

Constant Hex Value Key
VK_BACK 0x08 Backspace
VK_TAB 0x09 Tab
VK_RETURN 0x0D Enter
VK_SHIFT 0x10 Shift
VK_CONTROL 0x11 Ctrl
VK_MENU 0x12 Alt
VK_PAUSE 0x13 Pause
VK_CAPITAL 0x14 Caps Lock
VK_ESCAPE 0x1B Esc
VK_SPACE 0x20 Space

Navigation Keys

Constant Hex Value Key
VK_PRIOR 0x21 Page Up
VK_NEXT 0x22 Page Down
VK_END 0x23 End
VK_HOME 0x24 Home
VK_LEFT 0x25 Left Arrow
VK_UP 0x26 Up Arrow
VK_RIGHT 0x27 Right Arrow
VK_DOWN 0x28 Down Arrow

Editing Keys

Constant Hex Value Key
VK_INSERT 0x2D Insert
VK_DELETE 0x2E Delete

Number Keys (Top Row)

Constant Hex Value Key
VK_0 - VK_9 0x30 - 0x39 0 through 9

Letter Keys

Constant Hex Value Key
VK_A - VK_Z 0x41 - 0x5A A through Z

Windows Keys

Constant Hex Value Key
VK_LWIN 0x5B Left Windows key
VK_RWIN 0x5C Right Windows key
VK_APPS 0x5D Applications key (context menu)

Numpad Keys

Constant Hex Value Key
VK_NUMPAD0 - VK_NUMPAD9 0x60 - 0x69 Numpad 0 through 9
VK_MULTIPLY 0x6A Numpad *
VK_ADD 0x6B Numpad +
VK_SEPARATOR 0x6C Numpad separator
VK_SUBTRACT 0x6D Numpad -
VK_DECIMAL 0x6E Numpad .
VK_DIVIDE 0x6F Numpad /

Function Keys

Constant Hex Value Key
VK_F1 - VK_F12 0x70 - 0x7B F1 through F12

Lock Keys

Constant Hex Value Key
VK_NUMLOCK 0x90 Num Lock
VK_SCROLL 0x91 Scroll Lock

Shift Variants

Constant Hex Value Key
VK_LSHIFT 0xA0 Left Shift
VK_RSHIFT 0xA1 Right Shift
VK_LCONTROL 0xA2 Left Ctrl
VK_RCONTROL 0xA3 Right Ctrl
VK_LMENU 0xA4 Left Alt
VK_RMENU 0xA5 Right Alt

Browser Keys

Constant Hex Value Key
VK_BROWSER_BACK 0xA6 Browser Back
VK_BROWSER_FORWARD 0xA7 Browser Forward
VK_BROWSER_REFRESH 0xA8 Browser Refresh
VK_BROWSER_STOP 0xA9 Browser Stop
VK_BROWSER_SEARCH 0xAA Browser Search
VK_BROWSER_FAVORITES 0xAB Browser Favorites
VK_BROWSER_HOME 0xAC Browser Home

Media Keys

Constant Hex Value Key
VK_VOLUME_MUTE 0xAD Volume Mute
VK_VOLUME_DOWN 0xAE Volume Down
VK_VOLUME_UP 0xAF Volume Up
VK_MEDIA_NEXT_TRACK 0xB0 Next Track
VK_MEDIA_PREV_TRACK 0xB1 Previous Track
VK_MEDIA_STOP 0xB2 Stop Media
VK_MEDIA_PLAY_PAUSE 0xB3 Play/Pause Media

Punctuation Keys

Constant Hex Value Key
VK_OEM_1 0xBA ; :
VK_OEM_PLUS 0xBB = +
VK_OEM_COMMA 0xBC , <
VK_OEM_MINUS 0xBD - _
VK_OEM_PERIOD 0xBE . >
VK_OEM_2 0xBF / ?
VK_OEM_3 0xC0 ` ~
VK_OEM_4 0xDB [ {
VK_OEM_5 0xDC \ |
VK_OEM_6 0xDD ] }
VK_OEM_7 0xDE ' "

Built-in Gesture Patterns

Pattern Name Directions Description Common Use
'right' R Drag right Forward navigation, next item
'left' L Drag left Back navigation, previous item
'up' U Drag up Scroll to top, collapse
'down' D Drag down Scroll to bottom, expand
'L' D, R Down then right (L-shape) New tab, new item
'inverted-L' D, L Down then left (inverted L) Close tab, delete item

Timer API Reference

Function Parameters Returns Description
wakaPAC.setTimer(pacId, elapse) pacId: Component ID
elapse: Interval in ms
number (timer ID) Creates a timer that fires every elapse milliseconds. Returns auto-generated timer ID.
wakaPAC.killTimer(pacId, timerId) pacId: Component ID
timerId: Timer to stop
boolean Stops a specific timer. Returns true if timer was found and killed.
wakaPAC.killAllTimers(pacId) pacId: Component ID number Stops all timers for a component. Returns number of timers killed.

Coordinate Conversion Functions

Function Parameters Returns Description
this.containerToViewport(x, y) x: Container X
y: Container Y
{x, y} Converts container-relative to viewport-absolute coordinates
this.viewportToContainer(x, y) x: Viewport X
y: Viewport Y
{x, y} Converts viewport-absolute to container-relative coordinates
wakaPAC.LOWORD(lParam) lParam: Packed value number Extracts low 16 bits (X coordinate)
wakaPAC.HIWORD(lParam) lParam: Packed value number Extracts high 16 bits (Y coordinate)
wakaPAC.MAKEPOINTS(lParam) lParam: Packed value {x, y} Extracts both coordinates at once
wakaPAC.GET_WHEEL_DELTA(wParam) wParam: Mouse wheel wParam number Extracts wheel delta from wParam (±120 per notch, normalized). Positive = scroll up, negative = scroll down
wakaPAC.GET_KEYSTATE(wParam) wParam: Mouse wheel wParam number Extracts modifier key flags from wParam (MK_SHIFT, MK_CONTROL, MK_ALT)