X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin3_src%2FWM%2Fwm_input.c;h=1fc49f8e6c715ec8c61c33a86bcab655b1cfc043;hb=f0c407e7d468bc5acfd8d436be7f79f6e6248421;hp=f15d25a7ec1768d29d1ae9dcd06afffd32d7a561;hpb=2f16fec349eabb42f5e23ea2b821f149fa6b767e;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin3_src/WM/wm_input.c b/Usermode/Applications/axwin3_src/WM/wm_input.c index f15d25a7..1fc49f8e 100644 --- a/Usermode/Applications/axwin3_src/WM/wm_input.c +++ b/Usermode/Applications/axwin3_src/WM/wm_input.c @@ -13,6 +13,7 @@ // === IMPORTS === extern tWindow *gpWM_RootWindow; +extern tWindow *gpWM_FocusedWindow; // === GLOBALS === //! Window in which the mouse button was originally pressed @@ -110,3 +111,30 @@ void WM_Input_MouseButton(int X, int Y, int ButtonIndex, int Pressed) WM_Input_int_SendBtnMsg(win, X, Y, ButtonIndex, Pressed); } +void WM_Input_KeyDown(uint32_t Character, uint32_t Scancode) +{ + struct sWndMsg_KeyAction msg; + msg.KeySym = Scancode; + msg.UCS32 = Character; + WM_SendMessage(NULL, gpWM_FocusedWindow, WNDMSG_KEYDOWN, sizeof(msg), &msg); +} + +void WM_Input_KeyFire(uint32_t Character, uint32_t Scancode) +{ + struct sWndMsg_KeyAction msg; + + // TODO: Properly translate into KeySyms and Unicode + + msg.KeySym = Scancode; + msg.UCS32 = Character; + WM_SendMessage(NULL, gpWM_FocusedWindow, WNDMSG_KEYFIRE, sizeof(msg), &msg); +} + +void WM_Input_KeyUp(uint32_t Character, uint32_t Scancode) +{ + struct sWndMsg_KeyAction msg; + msg.KeySym = Scancode; + msg.UCS32 = Character; + WM_SendMessage(NULL, gpWM_FocusedWindow, WNDMSG_KEYUP, sizeof(msg), &msg); +} +