xorg driver, mouse, keybaord working in 1.7.0 and newer xorg

ulab-next
Jay Sorg 12 years ago
parent 74861acfa2
commit 52266913bd

@ -13,14 +13,34 @@ copy libxorgxrdp.so to /usr/lib/xorg/modules
copy xrdpmouse_drv.so to /usr/lib/xorg/modules/input copy xrdpmouse_drv.so to /usr/lib/xorg/modules/input
copy xrdpkeyb_drv.so to /usr/lib/xorg/modules/input copy xrdpkeyb_drv.so to /usr/lib/xorg/modules/input
strat xserver like this start xserver like this
Xorg -modulepath /usr/lib/xorg/modules -config xrdp/xorg.conf -logfile /tmp/Xjay.log -novtswitch -sharevts -noreset -nohwaccess -ac :10 Xorg -modulepath /usr/lib/xorg/modules -config xrdp/xorg.conf -logfile /tmp/Xjay.log -novtswitch -sharevts -noreset -nohwaccess -ac :10
or this on older Xorg but need /dev/vc/ thing below
Xorg -modulepath /home/jay/xorg-modules -config xrdp/xorg.conf -logfile /tmp/Xjay.log -novtswitch -sharevts -noreset -ac vt7 :10
older Xorg don't have -nohwaccess so you need to run Xorg as root older Xorg don't have -nohwaccess so you need to run Xorg as root
or do something like this. or do something like this.
sudo rm /dev/tty0 sudo rm /dev/tty0
sudo mknod -m 666 /dev/vc/7 c 7 7 sudo mknod -m 666 /dev/tty0 c 4 0
sudo mkdir /dev/vc/ sudo mkdir /dev/vc/
sudo mknod -m 666 /dev/tty0 c 4 0 sudo mknod -m 666 /dev/vc/7 c 7 7
--modules
libfb.so
libint10.so
libvbe.so
libxorgxrdp.so
----drivers
xrdpdev_drv.so
----extensions
libdbe.so
libdri.so
libdri2.so
libextmod.so
libglx.so
librecord.so
----input
xrdpkeyb_drv.so
xrdpmouse_drv.so

@ -205,23 +205,17 @@ static KeySym g_kbdMap[] =
static void static void
rdpEnqueueKey(int type, int scancode) rdpEnqueueKey(int type, int scancode)
{ {
int i; if (type == KeyPress)
int n;
EventListPtr rdp_events;
xEvent *pev;
i = GetEventList(&rdp_events);
LLOGLN(0, ("rdpEnqueueKey: i %d g_keyboard %p %p", i, g_keyboard, rdp_events));
n = GetKeyboardEvents(rdp_events, g_keyboard, type, scancode);
LLOGLN(0, ("rdpEnqueueKey: n %d", n));
for (i = 0; i < n; i++)
{ {
pev = (rdp_events + i)->event; xf86PostKeyboardEvent(g_keyboard, scancode, 1);
mieqEnqueue(g_keyboard, (InternalEvent *)pev); }
else
{
xf86PostKeyboardEvent(g_keyboard, scancode, 0);
} }
} }
#if 0 #if 1
/******************************************************************************/ /******************************************************************************/
static CARD32 static CARD32
rdpDeferredUpdateCallback(OsTimerPtr timer, CARD32 now, pointer arg) rdpDeferredUpdateCallback(OsTimerPtr timer, CARD32 now, pointer arg)
@ -231,8 +225,8 @@ rdpDeferredUpdateCallback(OsTimerPtr timer, CARD32 now, pointer arg)
rdpEnqueueKey(KeyPress, 115); rdpEnqueueKey(KeyPress, 115);
rdpEnqueueKey(KeyRelease, 115); rdpEnqueueKey(KeyRelease, 115);
//xf86PostKeyboardEvent(g_keyboard, 9, 1); //xf86PostKeyboardEvent(g_keyboard, 115, 1);
//xf86PostKeyboardEvent(g_keyboard, 9, 0); //xf86PostKeyboardEvent(g_keyboard, 115, 0);
g_timer = TimerSet(g_timer, 0, 1000, rdpDeferredUpdateCallback, 0); g_timer = TimerSet(g_timer, 0, 1000, rdpDeferredUpdateCallback, 0);
return 0; return 0;
@ -241,13 +235,13 @@ rdpDeferredUpdateCallback(OsTimerPtr timer, CARD32 now, pointer arg)
/******************************************************************************/ /******************************************************************************/
void void
rdpKeybDeviceInit(DeviceIntPtr pDevice, KeySymsPtr pKeySyms, CARD8 *pModMap) rdpkeybDeviceInit(DeviceIntPtr pDevice, KeySymsPtr pKeySyms, CARD8 *pModMap)
{ {
int i; int i;
LLOGLN(0, ("rdpKeybDeviceInit:")); LLOGLN(0, ("rdpkeybDeviceInit:"));
LLOGLN(10, (" MAP_LENGTH %d GLYPHS_PER_KEY %d N_PREDEFINED_KEYS %d", LLOGLN(10, (" MAP_LENGTH %d GLYPHS_PER_KEY %d N_PREDEFINED_KEYS %d",
MAP_LENGTH, GLYPHS_PER_KEY, N_PREDEFINED_KEYS)); MAP_LENGTH, GLYPHS_PER_KEY, (int) N_PREDEFINED_KEYS));
for (i = 0; i < MAP_LENGTH; i++) for (i = 0; i < MAP_LENGTH; i++)
{ {
@ -271,7 +265,7 @@ rdpKeybDeviceInit(DeviceIntPtr pDevice, KeySymsPtr pKeySyms, CARD8 *pModMap)
pKeySyms->map = (KeySym *)malloc(i); pKeySyms->map = (KeySym *)malloc(i);
if (pKeySyms->map == 0) if (pKeySyms->map == 0)
{ {
LLOGLN(0, ("rdpKeybDeviceInit: malloc failed")); LLOGLN(0, ("rdpkeybDeviceInit: malloc failed"));
exit(1); exit(1);
} }
else else
@ -292,89 +286,121 @@ rdpKeybDeviceInit(DeviceIntPtr pDevice, KeySymsPtr pKeySyms, CARD8 *pModMap)
/******************************************************************************/ /******************************************************************************/
static void static void
rdpKeybDeviceOn(void) rdpkeybDeviceOn(void)
{ {
LLOGLN(0, ("rdpKeybDeviceOn:")); LLOGLN(0, ("rdpkeybDeviceOn:"));
} }
/******************************************************************************/ /******************************************************************************/
static void static void
rdpKeybDeviceOff(void) rdpkeybDeviceOff(void)
{ {
LLOGLN(0, ("rdpKeybDeviceOff:")); LLOGLN(0, ("rdpkeybDeviceOff:"));
} }
/******************************************************************************/ /******************************************************************************/
static void static void
rdpKeybBell(int volume, DeviceIntPtr pDev, pointer ctrl, int cls) rdpkeybBell(int volume, DeviceIntPtr pDev, pointer ctrl, int cls)
{ {
LLOGLN(0, ("rdpKeybBell:")); LLOGLN(0, ("rdpkeybBell:"));
} }
/******************************************************************************/ /******************************************************************************/
static void static void
rdpKeybChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl) rdpkeybChangeKeyboardControl(DeviceIntPtr pDev, KeybdCtrl *ctrl)
{ {
LLOGLN(0, ("rdpKeybChangeKeyboardControl:")); LLOGLN(0, ("rdpkeybChangeKeyboardControl:"));
} }
/******************************************************************************/ /******************************************************************************/
static int static int
rdpKeybControl(DeviceIntPtr device, int what) rdpkeybControl(DeviceIntPtr device, int what)
{ {
KeySymsRec keySyms; KeySymsRec keySyms;
CARD8 modMap[MAP_LENGTH]; CARD8 modMap[MAP_LENGTH];
DevicePtr pDev; DevicePtr pDev;
XkbRMLVOSet set; XkbRMLVOSet set;
LLOGLN(0, ("rdpKeybControl: what %d", what)); LLOGLN(0, ("rdpkeybControl: what %d", what));
pDev = (DevicePtr)device; pDev = (DevicePtr)device;
switch (what) switch (what)
{ {
case DEVICE_INIT: case DEVICE_INIT:
rdpKeybDeviceInit(device, &keySyms, modMap); rdpkeybDeviceInit(device, &keySyms, modMap);
memset(&set, 0, sizeof(set)); memset(&set, 0, sizeof(set));
set.rules = "base"; set.rules = "base";
set.model = "pc104"; set.model = "pc104";
set.layout = "us"; set.layout = "us";
set.variant = ""; set.variant = "";
set.options = ""; set.options = "";
InitKeyboardDeviceStruct(device, &set, rdpKeybBell, InitKeyboardDeviceStruct(device, &set, rdpkeybBell,
rdpKeybChangeKeyboardControl); rdpkeybChangeKeyboardControl);
g_keyboard = device; g_keyboard = device;
//g_timer = TimerSet(g_timer, 0, 1000, rdpDeferredUpdateCallback, 0); g_timer = TimerSet(g_timer, 0, 1000, rdpDeferredUpdateCallback, 0);
break; break;
case DEVICE_ON: case DEVICE_ON:
pDev->on = 1; pDev->on = 1;
rdpKeybDeviceOn(); rdpkeybDeviceOn();
break; break;
case DEVICE_OFF: case DEVICE_OFF:
pDev->on = 0; pDev->on = 0;
rdpKeybDeviceOff(); rdpkeybDeviceOff();
break; break;
case DEVICE_CLOSE: case DEVICE_CLOSE:
if (pDev->on) if (pDev->on)
{ {
rdpKeybDeviceOff(); rdpkeybDeviceOff();
} }
break; break;
} }
return Success; return Success;
} }
#if XORG_VERSION_CURRENT < (((1) * 10000000) + ((9) * 100000) + ((0) * 1000) + 1)
/* debian 6
ubuntu 10.04 */
/******************************************************************************/
static InputInfoPtr
rdpkeybPreInit(InputDriverPtr drv, IDevPtr dev, int flags)
{
InputInfoPtr info;
LLOGLN(0, ("rdpkeybPreInit: drv %p dev %p, flags 0x%x",
drv, dev, flags));
info = xf86AllocateInput(drv, 0);
info->name = dev->identifier;
info->device_control = rdpkeybControl;
info->flags = XI86_CONFIGURED | XI86_ALWAYS_CORE | XI86_SEND_DRAG_EVENTS |
XI86_CORE_KEYBOARD | XI86_KEYBOARD_CAPABLE;
info->type_name = "Keyboard";
info->fd = -1;
info->conf_idev = dev;
return info;
}
#else
/* debian 7
ubuntu 12.04 */
/******************************************************************************/ /******************************************************************************/
static int static int
rdpkeybPreInit(InputDriverPtr drv, InputInfoPtr info, int flags) rdpkeybPreInit(InputDriverPtr drv, InputInfoPtr info, int flags)
{ {
LLOGLN(0, ("rdpkeybPreInit: drv %p info %p, flags 0x%x", LLOGLN(0, ("rdpkeybPreInit: drv %p info %p, flags 0x%x",
drv, info, flags)); drv, info, flags));
info->device_control = rdpKeybControl; info->device_control = rdpkeybControl;
info->type_name = "Keyboard"; info->type_name = "Keyboard";
return 0; return 0;
} }
#endif
/******************************************************************************/ /******************************************************************************/
static void static void
rdpkeybUnInit(InputDriverPtr drv, InputInfoPtr info, int flags) rdpkeybUnInit(InputDriverPtr drv, InputInfoPtr info, int flags)

@ -58,48 +58,48 @@ xrdp mouse module
/******************************************************************************/ /******************************************************************************/
static void static void
rdpMouseDeviceInit(void) rdpmouseDeviceInit(void)
{ {
LLOGLN(0, ("rdpMouseDeviceInit:")); LLOGLN(0, ("rdpmouseDeviceInit:"));
} }
/******************************************************************************/ /******************************************************************************/
static void static void
rdpMouseDeviceOn(DeviceIntPtr pDev) rdpmouseDeviceOn(DeviceIntPtr pDev)
{ {
LLOGLN(0, ("rdpMouseDeviceOn:")); LLOGLN(0, ("rdpmouseDeviceOn:"));
} }
/******************************************************************************/ /******************************************************************************/
static void static void
rdpMouseDeviceOff(void) rdpmouseDeviceOff(void)
{ {
LLOGLN(0, ("rdpMouseDeviceOff:")); LLOGLN(0, ("rdpmouseDeviceOff:"));
} }
/******************************************************************************/ /******************************************************************************/
static void static void
rdpMouseCtrl(DeviceIntPtr pDevice, PtrCtrl *pCtrl) rdpmouseCtrl(DeviceIntPtr pDevice, PtrCtrl *pCtrl)
{ {
LLOGLN(0, ("rdpMouseCtrl:")); LLOGLN(0, ("rdpmouseCtrl:"));
} }
/******************************************************************************/ /******************************************************************************/
static int static int
rdpMouseControl(DeviceIntPtr device, int what) rdpmouseControl(DeviceIntPtr device, int what)
{ {
BYTE map[6]; BYTE map[6];
DevicePtr pDev; DevicePtr pDev;
Atom btn_labels[6]; Atom btn_labels[6];
Atom axes_labels[2]; Atom axes_labels[2];
LLOGLN(0, ("rdpMouseControl: what %d", what)); LLOGLN(0, ("rdpmouseControl: what %d", what));
pDev = (DevicePtr)device; pDev = (DevicePtr)device;
switch (what) switch (what)
{ {
case DEVICE_INIT: case DEVICE_INIT:
rdpMouseDeviceInit(); rdpmouseDeviceInit();
map[0] = 0; map[0] = 0;
map[1] = 1; map[1] = 1;
map[2] = 2; map[2] = 2;
@ -116,23 +116,23 @@ rdpMouseControl(DeviceIntPtr device, int what)
axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X); axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_X);
axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y); axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_Y);
InitPointerDeviceStruct(pDev, map, 5, btn_labels, rdpMouseCtrl, InitPointerDeviceStruct(pDev, map, 5, btn_labels, rdpmouseCtrl,
GetMotionHistorySize(), 2, axes_labels); GetMotionHistorySize(), 2, axes_labels);
break; break;
case DEVICE_ON: case DEVICE_ON:
pDev->on = 1; pDev->on = 1;
rdpMouseDeviceOn(device); rdpmouseDeviceOn(device);
break; break;
case DEVICE_OFF: case DEVICE_OFF:
pDev->on = 0; pDev->on = 0;
rdpMouseDeviceOff(); rdpmouseDeviceOff();
break; break;
case DEVICE_CLOSE: case DEVICE_CLOSE:
if (pDev->on) if (pDev->on)
{ {
rdpMouseDeviceOff(); rdpmouseDeviceOff();
} }
break; break;
@ -141,54 +141,49 @@ rdpMouseControl(DeviceIntPtr device, int what)
return Success; return Success;
} }
/******************************************************************************/ #if XORG_VERSION_CURRENT < (((1) * 10000000) + ((9) * 100000) + ((0) * 1000) + 1)
static void
rdpMouseReadInput(struct _InputInfoRec *local)
{
LLOGLN(0, ("rdpMouseReadInput:"));
}
/******************************************************************************/ /* debian 6
static int ubuntu 10.04 */
rdpMouseControlProc(struct _InputInfoRec *local, xDeviceCtl *control)
{
LLOGLN(0, ("rdpMouseControlProc:"));
return 0;
}
/******************************************************************************/ /******************************************************************************/
static int static InputInfoPtr
rdpMouseSwitchMode(ClientPtr client, DeviceIntPtr dev, int mode) rdpmousePreInit(InputDriverPtr drv, IDevPtr dev, int flags)
{ {
LLOGLN(0, ("rdpMouseSwitchMode:")); InputInfoPtr info;
return 0;
}
/******************************************************************************/ LLOGLN(0, ("rdpmousePreInit: drv %p dev %p, flags 0x%x",
static int drv, dev, flags));
rdpMouseSetDeviceValuators(struct _InputInfoRec *local, info = xf86AllocateInput(drv, 0);
int *valuators, int first_valuator, info->name = dev->identifier;
int num_valuators) info->device_control = rdpmouseControl;
{ info->flags = XI86_CONFIGURED | XI86_ALWAYS_CORE | XI86_SEND_DRAG_EVENTS |
LLOGLN(0, ("rdpMouseSetDeviceValuators:")); XI86_CORE_POINTER | XI86_POINTER_CAPABLE;
return 0; info->type_name = "Mouse";
info->fd = -1;
info->conf_idev = dev;
return info;
} }
#else
/* debian 7
ubuntu 12.04 */
/******************************************************************************/ /******************************************************************************/
static int static int
rdpmousePreInit(InputDriverPtr drv, InputInfoPtr info, int flags) rdpmousePreInit(InputDriverPtr drv, InputInfoPtr info, int flags)
{ {
LLOGLN(0, ("rdpmousePreInit: drv %p info %p, flags 0x%x", LLOGLN(0, ("rdpmousePreInit: drv %p info %p, flags 0x%x",
drv, info, flags)); drv, info, flags));
info->device_control = rdpMouseControl; info->device_control = rdpmouseControl;
info->read_input = rdpMouseReadInput;
info->control_proc = rdpMouseControlProc;
info->switch_mode = rdpMouseSwitchMode;
info->set_device_valuators = rdpMouseSetDeviceValuators;
info->type_name = "Mouse"; info->type_name = "Mouse";
return 0; return 0;
} }
#endif
/******************************************************************************/ /******************************************************************************/
static void static void
rdpmouseUnInit(InputDriverPtr drv, InputInfoPtr info, int flags) rdpmouseUnInit(InputDriverPtr drv, InputInfoPtr info, int flags)

Loading…
Cancel
Save