diff options
author | Pierre Ossman <ossman@cendio.se> | 2013-04-09 15:53:47 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2013-04-09 15:53:47 +0000 |
commit | f17bc9a0ddf0ff26a5260c956218a84ec0a80e73 (patch) | |
tree | 0777e167cbed33ff0ce5aa2fc3bc1a7b158ff2ee | |
parent | 0b52ecc0cde48b95021b0315385fcbe9a0e7e5fd (diff) | |
download | tigervnc-f17bc9a0ddf0ff26a5260c956218a84ec0a80e73.tar.gz tigervnc-f17bc9a0ddf0ff26a5260c956218a84ec0a80e73.zip |
Move keyboardProc() so we have all the init stuff in one place.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5076 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r-- | unix/xserver/hw/vnc/Input.cc | 88 |
1 files changed, 41 insertions, 47 deletions
diff --git a/unix/xserver/hw/vnc/Input.cc b/unix/xserver/hw/vnc/Input.cc index 83a9e885..d36a4d76 100644 --- a/unix/xserver/hw/vnc/Input.cc +++ b/unix/xserver/hw/vnc/Input.cc @@ -64,9 +64,6 @@ using namespace rfb; static LogWriter vlog("Input"); #define BUTTONS 7 -static int pointerProc(DeviceIntPtr pDevice, int onoff); - -static int keyboardProc(DeviceIntPtr pDevice, int onoff); /* Event queue is shared between all devices. */ #if XORG == 15 @@ -262,6 +259,47 @@ static int pointerProc(DeviceIntPtr pDevice, int onoff) return Success; } +static void keyboardBell(int percent, DeviceIntPtr device, pointer ctrl, + int class_) +{ + if (percent > 0) + vncBell(); +} + +extern void GetInitKeyboardMap(KeySymsPtr keysyms, CARD8 *modmap); + +static int keyboardProc(DeviceIntPtr pDevice, int onoff) +{ +#if XORG < 17 + KeySymsRec keySyms; + CARD8 modMap[MAP_LENGTH]; +#endif + DevicePtr pDev = (DevicePtr)pDevice; + + switch (onoff) { + case DEVICE_INIT: +#if XORG < 17 + GetInitKeyboardMap(&keySyms, modMap); +#endif + InitKeyboardDeviceStruct( +#if XORG >= 17 + pDevice, NULL, +#else + pDev, &keySyms, modMap, +#endif + keyboardBell, (KbdCtrlProcPtr)NoopDDA); + break; + case DEVICE_ON: + pDev->on = TRUE; + break; + case DEVICE_OFF: + pDev->on = FALSE; + break; + } + + return Success; +} + void InputDevice::InitInputDevice(void) { if (initialized) @@ -568,47 +606,3 @@ void InputDevice::keyEvent(rdr::U32 keysym, bool down) */ mieqProcessInputEvents(); } - -static void keyboardBell(int percent, DeviceIntPtr device, pointer ctrl, - int class_) -{ - if (percent > 0) - vncBell(); -} - -static int keyboardProc(DeviceIntPtr pDevice, int onoff) -{ -#if XORG < 17 - KeySymsRec keySyms; - CARD8 modMap[MAP_LENGTH]; -#endif - DevicePtr pDev = (DevicePtr)pDevice; - - switch (onoff) { - case DEVICE_INIT: -#if XORG < 17 - GetMappings(&keySyms, modMap); -#endif - InitKeyboardDeviceStruct( -#if XORG >= 17 - pDevice, NULL, -#else - pDev, &keySyms, modMap, -#endif - keyboardBell, (KbdCtrlProcPtr)NoopDDA); - break; - case DEVICE_ON: - pDev->on = TRUE; - break; - case DEVICE_OFF: - pDev->on = FALSE; - break; -#if 0 - case DEVICE_CLOSE: - break; -#endif - } - - return Success; -} - |