Started hotkey support.

svn path=/trunk/; revision=6515
This commit is contained in:
Eric Kohl 2003-11-02 16:33:51 +00:00
parent bca263eb73
commit bf68eefdd1
7 changed files with 146 additions and 107 deletions

View file

@ -1196,14 +1196,12 @@ NtUserRegisterClassExWOW(CONST WNDCLASSEXW* lpwcx,
DWORD Unknown4, DWORD Unknown4,
DWORD Unknown5); DWORD Unknown5);
BOOL
DWORD
STDCALL STDCALL
NtUserRegisterHotKey( NtUserRegisterHotKey(HWND hWnd,
DWORD Unknown0, int id,
DWORD Unknown1, UINT fsModifiers,
DWORD Unknown2, UINT vk);
DWORD Unknown3);
DWORD DWORD
STDCALL STDCALL
@ -1720,11 +1718,10 @@ NtUserUnregisterClass(
DWORD Unknown1, DWORD Unknown1,
DWORD Unknown2); DWORD Unknown2);
DWORD BOOL
STDCALL STDCALL
NtUserUnregisterHotKey( NtUserUnregisterHotKey(HWND hWnd,
DWORD Unknown0, int id);
DWORD Unknown1);
DWORD DWORD
STDCALL STDCALL

View file

@ -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 * COPYRIGHT: See COPYING WINBOOLthe top level directory
* PROJECT: ReactOS user32.dll * PROJECT: ReactOS user32.dll
@ -293,20 +293,6 @@ RegisterDeviceNotificationW(
} }
#endif #endif
/*
* @unimplemented
*/
WINBOOL
STDCALL
RegisterHotKey(
HWND hWnd,
int id,
UINT fsModifiers,
UINT vk)
{
UNIMPLEMENTED;
return FALSE;
}
/* /*
* @unimplemented * @unimplemented
@ -386,20 +372,6 @@ UnregisterDeviceNotification(
} }
/*
* @unimplemented
*/
WINBOOL
STDCALL
UnregisterHotKey(
HWND hWnd,
int id)
{
UNIMPLEMENTED;
return FALSE;
}
/* /*
* @unimplemented * @unimplemented
*/ */

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 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 * PROJECT: ReactOS user32.dll
* FILE: lib/user32/windows/input.c * FILE: lib/user32/windows/input.c
@ -335,10 +335,24 @@ OemKeyScan(WORD wOemChar)
/* /*
* @implemented * @implemented
*/ */
WINBOOL WINBOOL STDCALL
STDCALL RegisterHotKey(HWND hWnd,
SetDoubleClickTime( int id,
UINT uInterval) UINT fsModifiers,
UINT vk)
{
return (WINBOOL)NtUserRegisterHotKey(hWnd,
id,
fsModifiers,
vk);
}
/*
* @implemented
*/
WINBOOL STDCALL
SetDoubleClickTime(UINT uInterval)
{ {
return (WINBOOL)NtUserSystemParametersInfo(SPI_SETDOUBLECLICKTIME, return (WINBOOL)NtUserSystemParametersInfo(SPI_SETDOUBLECLICKTIME,
uInterval, uInterval,
@ -455,6 +469,17 @@ UnloadKeyboardLayout(HKL hkl)
} }
/*
* @implemented
*/
WINBOOL STDCALL
UnregisterHotKey(HWND hWnd,
int id)
{
return (WINBOOL)NtUserUnregisterHotKey(hWnd, id);
}
/* /*
* @unimplemented * @unimplemented
*/ */

View file

@ -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 = ../.. 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 LDR_OBJECTS = ldr/loader.o
NTUSER_OBJECTS = ntuser/caret.o ntuser/class.o ntuser/guicheck.o ntuser/hook.o \ NTUSER_OBJECTS = ntuser/callback.o ntuser/caret.o ntuser/class.o ntuser/guicheck.o \
ntuser/message.o ntuser/msgqueue.o ntuser/stubs.o \ ntuser/hook.o ntuser/hotkey.o ntuser/input.o ntuser/keyboard.o \
ntuser/userobj.o ntuser/window.o ntuser/winsta.o ntuser/menu.o \ ntuser/menu.o ntuser/message.o ntuser/metric.o ntuser/misc.o \
ntuser/input.o ntuser/keyboard.o ntuser/callback.o \ ntuser/msgqueue.o ntuser/painting.o ntuser/prop.o ntuser/scrollbar.o \
ntuser/winpos.o ntuser/painting.o ntuser/metric.o \ ntuser/stubs.o ntuser/timer.o ntuser/userobj.o ntuser/vis.o \
ntuser/windc.o ntuser/prop.o ntuser/scrollbar.o \ ntuser/windc.o ntuser/window.o ntuser/winlock.o ntuser/winpos.o\
ntuser/timer.o ntuser/misc.o ntuser/vis.o \ ntuser/winsta.o
ntuser/winlock.o
OBJECTS_OBJECTS = objects/bitmaps.o objects/brush.o objects/cliprgn.o \ OBJECTS_OBJECTS = objects/bitmaps.o objects/brush.o objects/cliprgn.o \
objects/color.o objects/coord.o objects/dc.o \ objects/color.o objects/coord.o objects/dc.o \

View file

@ -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 <ddk/ntddk.h>
#include <win32k/win32k.h>
#include <win32k/userobj.h>
#include <include/msgqueue.h>
#define NDEBUG
#include <debug.h>
/* 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 */

View file

@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -102,8 +102,8 @@ KeyboardThreadMain(PVOID StartContext)
KEY_EVENT_RECORD KeyEvent; KEY_EVENT_RECORD KeyEvent;
LPARAM lParam = 0; LPARAM lParam = 0;
BOOLEAN SysKey; BOOLEAN SysKey;
Status = NtReadFile (KeyboardDeviceHandle, Status = NtReadFile (KeyboardDeviceHandle,
NULL, NULL,
NULL, NULL,
NULL, NULL,
@ -112,9 +112,9 @@ KeyboardThreadMain(PVOID StartContext)
sizeof(KEY_EVENT_RECORD), sizeof(KEY_EVENT_RECORD),
NULL, NULL,
NULL); NULL);
DPRINT( "KeyRaw: %s %04x\n", DPRINT( "KeyRaw: %s %04x\n",
KeyEvent.bKeyDown ? "down" : "up", KeyEvent.bKeyDown ? "down" : "up",
KeyEvent.wVirtualScanCode ); KeyEvent.wVirtualScanCode );
if (Status == STATUS_ALERTED && !InputThreadsRunning) if (Status == STATUS_ALERTED && !InputThreadsRunning)
{ {
@ -125,9 +125,9 @@ KeyboardThreadMain(PVOID StartContext)
DPRINT1("Win32K: Failed to read from keyboard.\n"); DPRINT1("Win32K: Failed to read from keyboard.\n");
return; //(Status); return; //(Status);
} }
SysKey = KeyEvent.dwControlKeyState & (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED); SysKey = KeyEvent.dwControlKeyState & (LEFT_ALT_PRESSED | RIGHT_ALT_PRESSED);
DPRINT( "Key: %s\n", KeyEvent.bKeyDown ? "down" : "up" ); DPRINT( "Key: %s\n", KeyEvent.bKeyDown ? "down" : "up" );
/* /*
* Post a keyboard message. * Post a keyboard message.
@ -138,19 +138,19 @@ KeyboardThreadMain(PVOID StartContext)
((KeyEvent.wVirtualScanCode << 16) & 0x00FF0000) | 0x40000000; ((KeyEvent.wVirtualScanCode << 16) & 0x00FF0000) | 0x40000000;
/* Bit 24 indicates if this is an extended key */ /* Bit 24 indicates if this is an extended key */
if (KeyEvent.dwControlKeyState & ENHANCED_KEY) if (KeyEvent.dwControlKeyState & ENHANCED_KEY)
{ {
lParam |= (1 << 24); lParam |= (1 << 24);
} }
if (SysKey) if (SysKey)
{ {
lParam |= (1 << 29); /* Context mode. 1 if ALT if pressed while the key is pressed */ lParam |= (1 << 29); /* Context mode. 1 if ALT if pressed while the key is pressed */
} }
MsqPostKeyboardMessage(SysKey ? WM_SYSKEYDOWN : WM_KEYDOWN, MsqPostKeyboardMessage(SysKey ? WM_SYSKEYDOWN : WM_KEYDOWN,
KeyEvent.wVirtualKeyCode, KeyEvent.wVirtualKeyCode,
lParam); lParam);
} }
else else
{ {
@ -158,16 +158,18 @@ KeyboardThreadMain(PVOID StartContext)
((KeyEvent.wVirtualScanCode << 16) & 0x00FF0000) | 0xC0000000; ((KeyEvent.wVirtualScanCode << 16) & 0x00FF0000) | 0xC0000000;
/* Bit 24 indicates if this is an extended key */ /* Bit 24 indicates if this is an extended key */
if (KeyEvent.dwControlKeyState & ENHANCED_KEY) if (KeyEvent.dwControlKeyState & ENHANCED_KEY)
{ {
lParam |= (1 << 24); lParam |= (1 << 24);
} }
if (SysKey) if (SysKey)
{ {
lParam |= (1 << 29); /* Context mode. 1 if ALT if pressed while the key is pressed */ lParam |= (1 << 29); /* Context mode. 1 if ALT if pressed while the key is pressed */
} }
MsqPostKeyboardMessage(SysKey ? WM_SYSKEYUP : WM_KEYUP, KeyEvent.wVirtualKeyCode,
MsqPostKeyboardMessage(SysKey ? WM_SYSKEYUP : WM_KEYUP,
KeyEvent.wVirtualKeyCode,
lParam); lParam);
} }
} }

View file

@ -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 * COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS kernel * PROJECT: ReactOS kernel
@ -850,18 +850,6 @@ NtUserQueryUserCounters(
return 0; return 0;
} }
DWORD
STDCALL
NtUserRegisterHotKey(
DWORD Unknown0,
DWORD Unknown1,
DWORD Unknown2,
DWORD Unknown3)
{
UNIMPLEMENTED
return 0;
}
DWORD DWORD
STDCALL STDCALL
@ -1025,17 +1013,6 @@ NtUserUnloadKeyboardLayout(
return 0; return 0;
} }
DWORD
STDCALL
NtUserUnregisterHotKey(
DWORD Unknown0,
DWORD Unknown1)
{
UNIMPLEMENTED
return 0;
}
DWORD DWORD
STDCALL STDCALL
NtUserUpdateInputContext( NtUserUpdateInputContext(