|
|
@ -44,6 +44,8 @@ keyboard and mouse stuff
|
|
|
|
#define DEBUG_OUT_INPUT(arg) ErrorF arg
|
|
|
|
#define DEBUG_OUT_INPUT(arg) ErrorF arg
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
extern ScreenPtr g_pScreen; /* in rdpmain.c */
|
|
|
|
|
|
|
|
|
|
|
|
static DeviceIntPtr g_kbdDevice = 0;
|
|
|
|
static DeviceIntPtr g_kbdDevice = 0;
|
|
|
|
static int g_old_button_mask = 0;
|
|
|
|
static int g_old_button_mask = 0;
|
|
|
|
static int g_pause_spe = 0;
|
|
|
|
static int g_pause_spe = 0;
|
|
|
@ -55,6 +57,9 @@ static int g_tab_down = 0;
|
|
|
|
above *_down vars */
|
|
|
|
above *_down vars */
|
|
|
|
static int g_scroll_lock_down = 0;
|
|
|
|
static int g_scroll_lock_down = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
static DeviceIntPtr g_mouse = 0;
|
|
|
|
|
|
|
|
static DeviceIntPtr g_keyboard = 0;
|
|
|
|
|
|
|
|
|
|
|
|
#define MIN_KEY_CODE 8
|
|
|
|
#define MIN_KEY_CODE 8
|
|
|
|
#define MAX_KEY_CODE 255
|
|
|
|
#define MAX_KEY_CODE 255
|
|
|
|
#define NO_OF_KEYS ((MAX_KEY_CODE - MIN_KEY_CODE) + 1)
|
|
|
|
#define NO_OF_KEYS ((MAX_KEY_CODE - MIN_KEY_CODE) + 1)
|
|
|
@ -234,12 +239,14 @@ static KeySym g_kbdMap[] =
|
|
|
|
NoSymbol, NoSymbol
|
|
|
|
NoSymbol, NoSymbol
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
/******************************************************************************/
|
|
|
|
/******************************************************************************/
|
|
|
|
static void
|
|
|
|
static void
|
|
|
|
rdpSendBell(void)
|
|
|
|
rdpSendBell(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
DEBUG_OUT_INPUT(("rdpSendBell\n"));
|
|
|
|
DEBUG_OUT_INPUT(("rdpSendBell\n"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
/******************************************************************************/
|
|
|
|
void
|
|
|
|
void
|
|
|
@ -297,6 +304,20 @@ KbdDeviceOff(void)
|
|
|
|
DEBUG_OUT_INPUT(("KbdDeviceOff\n"));
|
|
|
|
DEBUG_OUT_INPUT(("KbdDeviceOff\n"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
void
|
|
|
|
|
|
|
|
rdpBell(int volume, DeviceIntPtr pDev, pointer ctrl, int cls)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ErrorF("rdpBell:\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
void
|
|
|
|
|
|
|
|
rdpChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl* ctrl)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ErrorF("rdpChangeKeyboardControl:\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
/******************************************************************************/
|
|
|
|
int
|
|
|
|
int
|
|
|
|
rdpKeybdProc(DeviceIntPtr pDevice, int onoff)
|
|
|
|
rdpKeybdProc(DeviceIntPtr pDevice, int onoff)
|
|
|
@ -304,20 +325,29 @@ rdpKeybdProc(DeviceIntPtr pDevice, int onoff)
|
|
|
|
KeySymsRec keySyms;
|
|
|
|
KeySymsRec keySyms;
|
|
|
|
CARD8 modMap[MAP_LENGTH];
|
|
|
|
CARD8 modMap[MAP_LENGTH];
|
|
|
|
DevicePtr pDev;
|
|
|
|
DevicePtr pDev;
|
|
|
|
XkbRMLVOSet set[MAP_LENGTH];
|
|
|
|
XkbRMLVOSet set;
|
|
|
|
|
|
|
|
|
|
|
|
DEBUG_OUT_INPUT(("rdpKeybdProc\n"));
|
|
|
|
DEBUG_OUT_INPUT(("rdpKeybdProc\n"));
|
|
|
|
|
|
|
|
#if 1
|
|
|
|
pDev = (DevicePtr)pDevice;
|
|
|
|
pDev = (DevicePtr)pDevice;
|
|
|
|
switch (onoff)
|
|
|
|
switch (onoff)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case DEVICE_INIT:
|
|
|
|
case DEVICE_INIT:
|
|
|
|
KbdDeviceInit(pDevice, &keySyms, modMap);
|
|
|
|
KbdDeviceInit(pDevice, &keySyms, modMap);
|
|
|
|
InitKeyboardDeviceStruct(pDevice, set, (BellProcPtr)rdpSendBell,
|
|
|
|
memset(&set, 0, sizeof(set));
|
|
|
|
(KbdCtrlProcPtr)NoopDDA);
|
|
|
|
set.rules = "base";
|
|
|
|
|
|
|
|
set.model = "pc104";
|
|
|
|
|
|
|
|
set.layout = "us";
|
|
|
|
|
|
|
|
set.variant = "";
|
|
|
|
|
|
|
|
set.options = "";
|
|
|
|
|
|
|
|
InitKeyboardDeviceStruct(pDevice, &set, rdpBell,
|
|
|
|
|
|
|
|
rdpChangeKeyboardControl);
|
|
|
|
|
|
|
|
//XkbDDXChangeControls(pDevice, 0, 0);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case DEVICE_ON:
|
|
|
|
case DEVICE_ON:
|
|
|
|
pDev->on = 1;
|
|
|
|
pDev->on = 1;
|
|
|
|
KbdDeviceOn();
|
|
|
|
KbdDeviceOn();
|
|
|
|
|
|
|
|
g_keyboard = pDevice;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case DEVICE_OFF:
|
|
|
|
case DEVICE_OFF:
|
|
|
|
pDev->on = 0;
|
|
|
|
pDev->on = 0;
|
|
|
@ -330,6 +360,7 @@ rdpKeybdProc(DeviceIntPtr pDevice, int onoff)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
return Success;
|
|
|
|
return Success;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -361,42 +392,54 @@ PtrDeviceOff(void)
|
|
|
|
DEBUG_OUT_INPUT(("PtrDeviceOff\n"));
|
|
|
|
DEBUG_OUT_INPUT(("PtrDeviceOff\n"));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
|
|
|
rdpMouseCtrl(DeviceIntPtr pDevice, PtrCtrl* pCtrl)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
ErrorF("rdpMouseCtrl:\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
/******************************************************************************/
|
|
|
|
int
|
|
|
|
int
|
|
|
|
rdpMouseProc(DeviceIntPtr pDevice, int onoff)
|
|
|
|
rdpMouseProc(DeviceIntPtr pDevice, int onoff)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
BYTE map[6];
|
|
|
|
BYTE map[6];
|
|
|
|
DevicePtr pDev;
|
|
|
|
DevicePtr pDev;
|
|
|
|
|
|
|
|
Atom btn_labels[6];
|
|
|
|
|
|
|
|
Atom axes_labels[2];
|
|
|
|
|
|
|
|
|
|
|
|
DEBUG_OUT_INPUT(("rdpMouseProc\n"));
|
|
|
|
DEBUG_OUT_INPUT(("rdpMouseProc\n"));
|
|
|
|
pDev = (DevicePtr)pDevice;
|
|
|
|
pDev = (DevicePtr)pDevice;
|
|
|
|
switch (onoff)
|
|
|
|
switch (onoff)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case DEVICE_INIT:
|
|
|
|
case DEVICE_INIT:
|
|
|
|
PtrDeviceInit();
|
|
|
|
PtrDeviceInit();
|
|
|
|
map[0] = 0;
|
|
|
|
map[0] = 0;
|
|
|
|
map[1] = 1;
|
|
|
|
map[1] = 1;
|
|
|
|
map[2] = 2;
|
|
|
|
map[2] = 2;
|
|
|
|
map[3] = 3;
|
|
|
|
map[3] = 3;
|
|
|
|
map[4] = 4;
|
|
|
|
map[4] = 4;
|
|
|
|
map[5] = 5;
|
|
|
|
map[5] = 5;
|
|
|
|
//InitPointerDeviceStruct(pDevice, map, 5, 0, miPointerGetMotionEvents,
|
|
|
|
|
|
|
|
// PtrDeviceControl,
|
|
|
|
btn_labels[0] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_LEFT);
|
|
|
|
// miPointerGetMotionBufferSize(), 2, 0);
|
|
|
|
btn_labels[1] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_MIDDLE);
|
|
|
|
#if 0
|
|
|
|
btn_labels[2] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_RIGHT);
|
|
|
|
DevicePtr /*device*/,
|
|
|
|
btn_labels[3] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_UP);
|
|
|
|
CARD8* /*map*/,
|
|
|
|
btn_labels[4] = XIGetKnownProperty(BTN_LABEL_PROP_BTN_WHEEL_DOWN);
|
|
|
|
int /*numButtons*/,
|
|
|
|
|
|
|
|
Atom* /* btn_labels */,
|
|
|
|
axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X);
|
|
|
|
PtrCtrlProcPtr /*controlProc*/,
|
|
|
|
axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y);
|
|
|
|
int /*numMotionEvents*/,
|
|
|
|
|
|
|
|
int /*numAxes*/,
|
|
|
|
InitPointerDeviceStruct(pDev, map, 5, btn_labels, rdpMouseCtrl,
|
|
|
|
Atom* /* axes_labels */);
|
|
|
|
GetMotionHistorySize(), 2, axes_labels);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case DEVICE_ON:
|
|
|
|
case DEVICE_ON:
|
|
|
|
pDev->on = 1;
|
|
|
|
pDev->on = 1;
|
|
|
|
PtrDeviceOn(pDevice);
|
|
|
|
PtrDeviceOn(pDevice);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
g_mouse = pDevice;
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case DEVICE_OFF:
|
|
|
|
case DEVICE_OFF:
|
|
|
|
pDev->on = 0;
|
|
|
|
pDev->on = 0;
|
|
|
@ -635,41 +678,91 @@ rdpSpriteDeviceCursorCleanup(DeviceIntPtr pDev, ScreenPtr pScr)
|
|
|
|
ErrorF("rdpSpriteDeviceCursorCleanup:\n");
|
|
|
|
ErrorF("rdpSpriteDeviceCursorCleanup:\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
|
|
|
rdpEnqueueMotion(int x, int y)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
int n;
|
|
|
|
|
|
|
|
int valuators[2];
|
|
|
|
|
|
|
|
EventListPtr rdp_events;
|
|
|
|
|
|
|
|
xEvent* pev;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
miPointerSetPosition(g_mouse, &x, &y);
|
|
|
|
|
|
|
|
valuators[0] = x;
|
|
|
|
|
|
|
|
valuators[1] = y;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
GetEventList(&rdp_events);
|
|
|
|
|
|
|
|
n = GetPointerEvents(rdp_events, g_mouse, MotionNotify, 0,
|
|
|
|
|
|
|
|
POINTER_ABSOLUTE | POINTER_SCREEN,
|
|
|
|
|
|
|
|
0, 2, valuators);
|
|
|
|
|
|
|
|
for (i = 0; i < n; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
pev = (rdp_events + i)->event;
|
|
|
|
|
|
|
|
mieqEnqueue(g_mouse, (InternalEvent*)pev);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
|
|
|
rdpEnqueueButton(int type, int buttons)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
int n;
|
|
|
|
|
|
|
|
EventListPtr rdp_events;
|
|
|
|
|
|
|
|
xEvent* pev;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
i = GetEventList(&rdp_events);
|
|
|
|
|
|
|
|
n = GetPointerEvents(rdp_events, g_mouse, type, buttons, 0, 0, 0, 0);
|
|
|
|
|
|
|
|
for (i = 0; i < n; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
pev = (rdp_events + i)->event;
|
|
|
|
|
|
|
|
mieqEnqueue(g_mouse, (InternalEvent*)pev);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
|
|
|
|
static void
|
|
|
|
|
|
|
|
rdpEnqueueKey(int type, int scancode)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
int i;
|
|
|
|
|
|
|
|
int n;
|
|
|
|
|
|
|
|
EventListPtr rdp_events;
|
|
|
|
|
|
|
|
xEvent* pev;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
i = GetEventList(&rdp_events);
|
|
|
|
|
|
|
|
n = GetKeyboardEvents(rdp_events, g_keyboard, type, scancode);
|
|
|
|
|
|
|
|
for (i = 0; i < n; i++)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
pev = (rdp_events + i)->event;
|
|
|
|
|
|
|
|
mieqEnqueue(g_keyboard, (InternalEvent*)pev);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/******************************************************************************/
|
|
|
|
/******************************************************************************/
|
|
|
|
void
|
|
|
|
void
|
|
|
|
PtrAddEvent(int buttonMask, int x, int y)
|
|
|
|
PtrAddEvent(int buttonMask, int x, int y)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//xEvent ev;
|
|
|
|
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
|
unsigned long time;
|
|
|
|
int type;
|
|
|
|
//InternalEvent e;
|
|
|
|
int buttons;
|
|
|
|
|
|
|
|
|
|
|
|
//memset(&e, 0, sizeof(e));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
time = GetTimeInMillis();
|
|
|
|
rdpEnqueueMotion(x, y);
|
|
|
|
//todo PostSyntheticMotion();
|
|
|
|
|
|
|
|
//miPointerAbsoluteCursor(x, y, time);
|
|
|
|
|
|
|
|
for (i = 0; i < 5; i++)
|
|
|
|
for (i = 0; i < 5; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ((buttonMask ^ g_old_button_mask) & (1 << i))
|
|
|
|
if ((buttonMask ^ g_old_button_mask) & (1 << i))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (buttonMask & (1 << i))
|
|
|
|
if (buttonMask & (1 << i))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//e.header = ET_Internal;
|
|
|
|
type = ButtonPress;
|
|
|
|
//e.type = ET_ButtonPress;
|
|
|
|
buttons = i + 1;
|
|
|
|
|
|
|
|
rdpEnqueueButton(type, buttons);
|
|
|
|
//ev.u.u.type = ButtonPress;
|
|
|
|
|
|
|
|
//ev.u.u.detail = i + 1;
|
|
|
|
|
|
|
|
//ev.u.keyButtonPointer.time = time;
|
|
|
|
|
|
|
|
//mieqEnqueue(0, &ev); // todo
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//ET_ButtonRelease
|
|
|
|
type = ButtonRelease;
|
|
|
|
//ev.u.u.type = ButtonRelease;
|
|
|
|
buttons = i + 1;
|
|
|
|
//ev.u.u.detail = i + 1;
|
|
|
|
rdpEnqueueButton(type, buttons);
|
|
|
|
//ev.u.keyButtonPointer.time = time;
|
|
|
|
|
|
|
|
//mieqEnqueue(0, &ev); // todo
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -681,35 +774,19 @@ PtrAddEvent(int buttonMask, int x, int y)
|
|
|
|
void
|
|
|
|
void
|
|
|
|
check_keysa(void)
|
|
|
|
check_keysa(void)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
xEvent ev;
|
|
|
|
|
|
|
|
unsigned long time;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
time = GetTimeInMillis();
|
|
|
|
|
|
|
|
if (g_ctrl_down != 0)
|
|
|
|
if (g_ctrl_down != 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
memset(&ev, 0, sizeof(ev));
|
|
|
|
rdpEnqueueKey(KeyRelease, g_ctrl_down);
|
|
|
|
ev.u.u.type = KeyRelease;
|
|
|
|
|
|
|
|
ev.u.keyButtonPointer.time = time;
|
|
|
|
|
|
|
|
ev.u.u.detail = g_ctrl_down;
|
|
|
|
|
|
|
|
//mieqEnqueue(&ev);
|
|
|
|
|
|
|
|
g_ctrl_down = 0;
|
|
|
|
g_ctrl_down = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (g_alt_down != 0)
|
|
|
|
if (g_alt_down != 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
memset(&ev, 0, sizeof(ev));
|
|
|
|
rdpEnqueueKey(KeyRelease, g_alt_down);
|
|
|
|
ev.u.u.type = KeyRelease;
|
|
|
|
|
|
|
|
ev.u.keyButtonPointer.time = time;
|
|
|
|
|
|
|
|
ev.u.u.detail = g_alt_down;
|
|
|
|
|
|
|
|
//mieqEnqueue(&ev);
|
|
|
|
|
|
|
|
g_alt_down = 0;
|
|
|
|
g_alt_down = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (g_shift_down != 0)
|
|
|
|
if (g_shift_down != 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
memset(&ev, 0, sizeof(ev));
|
|
|
|
rdpEnqueueKey(KeyRelease, g_shift_down);
|
|
|
|
ev.u.u.type = KeyRelease;
|
|
|
|
|
|
|
|
ev.u.keyButtonPointer.time = time;
|
|
|
|
|
|
|
|
ev.u.u.detail = g_shift_down;
|
|
|
|
|
|
|
|
//mieqEnqueue(&ev);
|
|
|
|
|
|
|
|
g_shift_down = 0;
|
|
|
|
g_shift_down = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -718,17 +795,13 @@ check_keysa(void)
|
|
|
|
void
|
|
|
|
void
|
|
|
|
KbdAddEvent(int down, int param1, int param2, int param3, int param4)
|
|
|
|
KbdAddEvent(int down, int param1, int param2, int param3, int param4)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
xEvent ev;
|
|
|
|
|
|
|
|
unsigned long time;
|
|
|
|
|
|
|
|
int rdp_scancode;
|
|
|
|
int rdp_scancode;
|
|
|
|
int x_scancode;
|
|
|
|
int x_scancode;
|
|
|
|
int is_ext;
|
|
|
|
int is_ext;
|
|
|
|
int is_spe;
|
|
|
|
int is_spe;
|
|
|
|
|
|
|
|
int type;
|
|
|
|
|
|
|
|
|
|
|
|
memset(&ev, 0, sizeof(ev));
|
|
|
|
type = down ? KeyPress : KeyRelease;
|
|
|
|
ev.u.u.type = down ? KeyPress : KeyRelease;
|
|
|
|
|
|
|
|
time = GetTimeInMillis();
|
|
|
|
|
|
|
|
ev.u.keyButtonPointer.time = time;
|
|
|
|
|
|
|
|
rdp_scancode = param3;
|
|
|
|
rdp_scancode = param3;
|
|
|
|
is_ext = param4 & 256; /* 0x100 */
|
|
|
|
is_ext = param4 & 256; /* 0x100 */
|
|
|
|
is_spe = param4 & 512; /* 0x200 */
|
|
|
|
is_spe = param4 & 512; /* 0x200 */
|
|
|
@ -851,8 +924,7 @@ KbdAddEvent(int down, int param1, int param2, int param3, int param4)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (x_scancode > 0)
|
|
|
|
if (x_scancode > 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ev.u.u.detail = x_scancode;
|
|
|
|
rdpEnqueueKey(type, x_scancode);
|
|
|
|
//mieqEnqueue(&ev);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -864,32 +936,78 @@ KbdAddEvent(int down, int param1, int param2, int param3, int param4)
|
|
|
|
void
|
|
|
|
void
|
|
|
|
KbdSync(int param1)
|
|
|
|
KbdSync(int param1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
|
|
|
|
|
|
|
KeyClassPtr keyc;
|
|
|
|
KeyClassPtr keyc;
|
|
|
|
|
|
|
|
int mask;
|
|
|
|
|
|
|
|
int latches;
|
|
|
|
|
|
|
|
int status;
|
|
|
|
|
|
|
|
|
|
|
|
if (g_kbdDevice == 0)
|
|
|
|
if (g_kbdDevice == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mask = 0;
|
|
|
|
|
|
|
|
latches = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mask |= 1 << 1;
|
|
|
|
|
|
|
|
if (param1 & 4)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
latches |= 1 << 1;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
mask |= Mod1Mask;
|
|
|
|
|
|
|
|
if (param1 & 4)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
latches |= Mod1Mask;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ErrorF("mask 0x%x latches 0x%x\n", mask, latches);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
status = XkbLatchModifiers(g_keyboard, mask, latches);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ErrorF("status %d\n", status);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if 0
|
|
|
|
|
|
|
|
|
|
|
|
keyc = g_kbdDevice->key;
|
|
|
|
keyc = g_kbdDevice->key;
|
|
|
|
if (keyc == 0)
|
|
|
|
if (keyc == 0)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#if 0
|
|
|
|
|
|
|
|
if ((!(keyc->state & 0x02)) != (!(param1 & 4))) /* caps lock */
|
|
|
|
|
|
|
|
|
|
|
|
ErrorF("0x%x mods 0x%x\n", param1, keyc->xkbInfo->state.mods);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hexdump(keyc->down, DOWN_LENGTH);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hexdump(keyc->modifierKeyCount, 32);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hexdump(keyc->xkbInfo, sizeof(struct _XkbSrvInfo));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if 1
|
|
|
|
|
|
|
|
//if ((!(keyc->xkbInfo->state & 0x02)) != (!(param1 & 4))) /* caps lock */
|
|
|
|
|
|
|
|
if (param1 & 4) /* caps lock */
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KbdAddEvent(1, 58, 0, 58, 0);
|
|
|
|
KbdAddEvent(1, 58, 0, 58, 0);
|
|
|
|
KbdAddEvent(0, 58, 49152, 58, 49152);
|
|
|
|
KbdAddEvent(0, 58, 49152, 58, 49152);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((!(keyc->state & 0x10)) != (!(param1 & 2))) /* num lock */
|
|
|
|
//if ((!(keyc->state & 0x10)) != (!(param1 & 2))) /* num lock */
|
|
|
|
|
|
|
|
if (param1 & 2) /* num lock */
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KbdAddEvent(1, 69, 0, 69, 0);
|
|
|
|
KbdAddEvent(1, 69, 0, 69, 0);
|
|
|
|
KbdAddEvent(0, 69, 49152, 69, 49152);
|
|
|
|
KbdAddEvent(0, 69, 49152, 69, 49152);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
if ((!(g_scroll_lock_down)) != (!(param1 & 1))) /* scroll lock */
|
|
|
|
if ((!(g_scroll_lock_down)) != (!(param1 & 1))) /* scroll lock */
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KbdAddEvent(1, 70, 0, 70, 0);
|
|
|
|
KbdAddEvent(1, 70, 0, 70, 0);
|
|
|
|
KbdAddEvent(0, 70, 49152, 70, 49152);
|
|
|
|
KbdAddEvent(0, 70, 49152, 70, 49152);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|