diff --git a/reactos/include/win32k/ntuser.h b/reactos/include/win32k/ntuser.h index 2a095729c9f..a78321417d0 100644 --- a/reactos/include/win32k/ntuser.h +++ b/reactos/include/win32k/ntuser.h @@ -1196,14 +1196,12 @@ NtUserRegisterClassExWOW(CONST WNDCLASSEXW* lpwcx, DWORD Unknown4, DWORD Unknown5); - -DWORD +BOOL STDCALL -NtUserRegisterHotKey( - DWORD Unknown0, - DWORD Unknown1, - DWORD Unknown2, - DWORD Unknown3); +NtUserRegisterHotKey(HWND hWnd, + int id, + UINT fsModifiers, + UINT vk); DWORD STDCALL @@ -1720,11 +1718,10 @@ NtUserUnregisterClass( DWORD Unknown1, DWORD Unknown2); -DWORD +BOOL STDCALL -NtUserUnregisterHotKey( - DWORD Unknown0, - DWORD Unknown1); +NtUserUnregisterHotKey(HWND hWnd, + int id); DWORD STDCALL diff --git a/reactos/lib/user32/misc/stubs.c b/reactos/lib/user32/misc/stubs.c index e6868d26abf..eca46b69e01 100644 --- a/reactos/lib/user32/misc/stubs.c +++ b/reactos/lib/user32/misc/stubs.c @@ -1,4 +1,4 @@ -/* $Id: stubs.c,v 1.46 2003/11/02 06:58:57 navaraf Exp $ +/* $Id: stubs.c,v 1.47 2003/11/02 16:32:45 ekohl Exp $ * * COPYRIGHT: See COPYING WINBOOLthe top level directory * PROJECT: ReactOS user32.dll @@ -293,20 +293,6 @@ RegisterDeviceNotificationW( } #endif -/* - * @unimplemented - */ -WINBOOL -STDCALL -RegisterHotKey( - HWND hWnd, - int id, - UINT fsModifiers, - UINT vk) -{ - UNIMPLEMENTED; - return FALSE; -} /* * @unimplemented @@ -386,20 +372,6 @@ UnregisterDeviceNotification( } -/* - * @unimplemented - */ -WINBOOL -STDCALL -UnregisterHotKey( - HWND hWnd, - int id) -{ - UNIMPLEMENTED; - return FALSE; -} - - /* * @unimplemented */ diff --git a/reactos/lib/user32/windows/input.c b/reactos/lib/user32/windows/input.c index 58459dcf1fa..e9b1fcf8950 100644 --- a/reactos/lib/user32/windows/input.c +++ b/reactos/lib/user32/windows/input.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: input.c,v 1.19 2003/10/09 06:13:04 gvg Exp $ +/* $Id: input.c,v 1.20 2003/11/02 16:32:25 ekohl Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/windows/input.c @@ -335,10 +335,24 @@ OemKeyScan(WORD wOemChar) /* * @implemented */ -WINBOOL -STDCALL -SetDoubleClickTime( - UINT uInterval) +WINBOOL STDCALL +RegisterHotKey(HWND hWnd, + int id, + UINT fsModifiers, + UINT vk) +{ + return (WINBOOL)NtUserRegisterHotKey(hWnd, + id, + fsModifiers, + vk); +} + + +/* + * @implemented + */ +WINBOOL STDCALL +SetDoubleClickTime(UINT uInterval) { return (WINBOOL)NtUserSystemParametersInfo(SPI_SETDOUBLECLICKTIME, uInterval, @@ -455,6 +469,17 @@ UnloadKeyboardLayout(HKL hkl) } +/* + * @implemented + */ +WINBOOL STDCALL +UnregisterHotKey(HWND hWnd, + int id) +{ + return (WINBOOL)NtUserUnregisterHotKey(hWnd, id); +} + + /* * @unimplemented */ diff --git a/reactos/subsys/win32k/makefile b/reactos/subsys/win32k/makefile index 54240fff248..1cf626d7e2e 100644 --- a/reactos/subsys/win32k/makefile +++ b/reactos/subsys/win32k/makefile @@ -1,4 +1,4 @@ -# $Id: makefile,v 1.81 2003/10/28 19:30:08 gvg Exp $ +# $Id: makefile,v 1.82 2003/11/02 16:33:51 ekohl Exp $ PATH_TO_TOP = ../.. @@ -48,14 +48,13 @@ MISC_OBJECTS = misc/driver.o misc/error.o misc/math.o misc/object.o LDR_OBJECTS = ldr/loader.o -NTUSER_OBJECTS = ntuser/caret.o ntuser/class.o ntuser/guicheck.o ntuser/hook.o \ - ntuser/message.o ntuser/msgqueue.o ntuser/stubs.o \ - ntuser/userobj.o ntuser/window.o ntuser/winsta.o ntuser/menu.o \ - ntuser/input.o ntuser/keyboard.o ntuser/callback.o \ - ntuser/winpos.o ntuser/painting.o ntuser/metric.o \ - ntuser/windc.o ntuser/prop.o ntuser/scrollbar.o \ - ntuser/timer.o ntuser/misc.o ntuser/vis.o \ - ntuser/winlock.o +NTUSER_OBJECTS = ntuser/callback.o ntuser/caret.o ntuser/class.o ntuser/guicheck.o \ + ntuser/hook.o ntuser/hotkey.o ntuser/input.o ntuser/keyboard.o \ + ntuser/menu.o ntuser/message.o ntuser/metric.o ntuser/misc.o \ + ntuser/msgqueue.o ntuser/painting.o ntuser/prop.o ntuser/scrollbar.o \ + ntuser/stubs.o ntuser/timer.o ntuser/userobj.o ntuser/vis.o \ + ntuser/windc.o ntuser/window.o ntuser/winlock.o ntuser/winpos.o\ + ntuser/winsta.o OBJECTS_OBJECTS = objects/bitmaps.o objects/brush.o objects/cliprgn.o \ objects/color.o objects/coord.o objects/dc.o \ diff --git a/reactos/subsys/win32k/ntuser/hotkey.c b/reactos/subsys/win32k/ntuser/hotkey.c new file mode 100644 index 00000000000..79216e8e00e --- /dev/null +++ b/reactos/subsys/win32k/ntuser/hotkey.c @@ -0,0 +1,67 @@ +/* + * ReactOS W32 Subsystem + * Copyright (C) 2003 ReactOS Team + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ +/* $Id: hotkey.c,v 1.1 2003/11/02 16:33:33 ekohl Exp $ + * + * COPYRIGHT: See COPYING in the top level directory + * PROJECT: ReactOS kernel + * PURPOSE: HotKey support + * FILE: subsys/win32k/ntuser/hotkey.c + * PROGRAMER: Eric Kohl + * REVISION HISTORY: + * 02-11-2003 EK Created + */ + +/* INCLUDES ******************************************************************/ + +#include +#include +#include +#include + +#define NDEBUG +#include + +/* GLOBALS *******************************************************************/ + + +/* FUNCTIONS *****************************************************************/ + + +BOOL STDCALL +NtUserRegisterHotKey(HWND hWnd, + int id, + UINT fsModifiers, + UINT vk) +{ + UNIMPLEMENTED + + return FALSE; +} + + +BOOL STDCALL +NtUserUnregisterHotKey(HWND hWnd, + int id) +{ + UNIMPLEMENTED + + return FALSE; +} + +/* EOF */ diff --git a/reactos/subsys/win32k/ntuser/input.c b/reactos/subsys/win32k/ntuser/input.c index 10f0d1444b9..ef161309e43 100644 --- a/reactos/subsys/win32k/ntuser/input.c +++ b/reactos/subsys/win32k/ntuser/input.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: input.c,v 1.15 2003/10/18 20:41:10 vizzini Exp $ +/* $Id: input.c,v 1.16 2003/11/02 16:33:33 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -102,8 +102,8 @@ KeyboardThreadMain(PVOID StartContext) KEY_EVENT_RECORD KeyEvent; LPARAM lParam = 0; BOOLEAN SysKey; - - Status = NtReadFile (KeyboardDeviceHandle, + + Status = NtReadFile (KeyboardDeviceHandle, NULL, NULL, NULL, @@ -112,9 +112,9 @@ KeyboardThreadMain(PVOID StartContext) sizeof(KEY_EVENT_RECORD), NULL, NULL); - DPRINT( "KeyRaw: %s %04x\n", - KeyEvent.bKeyDown ? "down" : "up", - KeyEvent.wVirtualScanCode ); + DPRINT( "KeyRaw: %s %04x\n", + KeyEvent.bKeyDown ? "down" : "up", + KeyEvent.wVirtualScanCode ); if (Status == STATUS_ALERTED && !InputThreadsRunning) { @@ -125,9 +125,9 @@ KeyboardThreadMain(PVOID StartContext) DPRINT1("Win32K: Failed to read from keyboard.\n"); return; //(Status); } - - SysKey = KeyEvent.dwControlKeyState & (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED); - DPRINT( "Key: %s\n", KeyEvent.bKeyDown ? "down" : "up" ); + + SysKey = KeyEvent.dwControlKeyState & (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED); + DPRINT( "Key: %s\n", KeyEvent.bKeyDown ? "down" : "up" ); /* * Post a keyboard message. @@ -138,19 +138,19 @@ KeyboardThreadMain(PVOID StartContext) ((KeyEvent.wVirtualScanCode << 16) & 0x00FF0000) | 0x40000000; /* Bit 24 indicates if this is an extended key */ - if (KeyEvent.dwControlKeyState & ENHANCED_KEY) - { - lParam |= (1 << 24); - } + if (KeyEvent.dwControlKeyState & ENHANCED_KEY) + { + lParam |= (1 << 24); + } - if (SysKey) - { - lParam |= (1 << 29); /* Context mode. 1 if ALT if pressed while the key is pressed */ - } + if (SysKey) + { + lParam |= (1 << 29); /* Context mode. 1 if ALT if pressed while the key is pressed */ + } - MsqPostKeyboardMessage(SysKey ? WM_SYSKEYDOWN : WM_KEYDOWN, - KeyEvent.wVirtualKeyCode, - lParam); + MsqPostKeyboardMessage(SysKey ? WM_SYSKEYDOWN : WM_KEYDOWN, + KeyEvent.wVirtualKeyCode, + lParam); } else { @@ -158,16 +158,18 @@ KeyboardThreadMain(PVOID StartContext) ((KeyEvent.wVirtualScanCode << 16) & 0x00FF0000) | 0xC0000000; /* Bit 24 indicates if this is an extended key */ - if (KeyEvent.dwControlKeyState & ENHANCED_KEY) - { - lParam |= (1 << 24); - } + if (KeyEvent.dwControlKeyState & ENHANCED_KEY) + { + lParam |= (1 << 24); + } - if (SysKey) - { - lParam |= (1 << 29); /* Context mode. 1 if ALT if pressed while the key is pressed */ - } - MsqPostKeyboardMessage(SysKey ? WM_SYSKEYUP : WM_KEYUP, KeyEvent.wVirtualKeyCode, + if (SysKey) + { + lParam |= (1 << 29); /* Context mode. 1 if ALT if pressed while the key is pressed */ + } + + MsqPostKeyboardMessage(SysKey ? WM_SYSKEYUP : WM_KEYUP, + KeyEvent.wVirtualKeyCode, lParam); } } diff --git a/reactos/subsys/win32k/ntuser/stubs.c b/reactos/subsys/win32k/ntuser/stubs.c index b61de76cf57..318f99b0a63 100644 --- a/reactos/subsys/win32k/ntuser/stubs.c +++ b/reactos/subsys/win32k/ntuser/stubs.c @@ -1,4 +1,4 @@ -/* $Id: stubs.c,v 1.30 2003/10/15 20:48:19 weiden Exp $ +/* $Id: stubs.c,v 1.31 2003/11/02 16:33:33 ekohl Exp $ * * COPYRIGHT: See COPYING in the top level directory * PROJECT: ReactOS kernel @@ -850,18 +850,6 @@ NtUserQueryUserCounters( return 0; } -DWORD -STDCALL -NtUserRegisterHotKey( - DWORD Unknown0, - DWORD Unknown1, - DWORD Unknown2, - DWORD Unknown3) -{ - UNIMPLEMENTED - - return 0; -} DWORD STDCALL @@ -1025,17 +1013,6 @@ NtUserUnloadKeyboardLayout( return 0; } -DWORD -STDCALL -NtUserUnregisterHotKey( - DWORD Unknown0, - DWORD Unknown1) -{ - UNIMPLEMENTED - - return 0; -} - DWORD STDCALL NtUserUpdateInputContext(