102 |
static XIM g_IM; |
static XIM g_IM; |
103 |
static XIC g_IC; |
static XIC g_IC; |
104 |
static XModifierKeymap *g_mod_map; |
static XModifierKeymap *g_mod_map; |
105 |
|
/* Maps logical (xmodmap -pp) pointing device buttons (0-based) back |
106 |
|
to physical (1-based) indices. */ |
107 |
|
static unsigned char g_pointer_log_to_phys_map[16]; |
108 |
static Cursor g_current_cursor; |
static Cursor g_current_cursor; |
109 |
static RD_HCURSOR g_null_cursor = NULL; |
static RD_HCURSOR g_null_cursor = NULL; |
110 |
static Atom g_protocol_atom, g_kill_atom; |
static Atom g_protocol_atom, g_kill_atom; |
1263 |
return out; |
return out; |
1264 |
} |
} |
1265 |
|
|
1266 |
|
static void |
1267 |
|
xwin_refresh_pointer_map(void) |
1268 |
|
{ |
1269 |
|
unsigned char phys_to_log_map[sizeof(g_pointer_log_to_phys_map)]; |
1270 |
|
int i, pointer_buttons; |
1271 |
|
|
1272 |
|
pointer_buttons = XGetPointerMapping(g_display, phys_to_log_map, sizeof(phys_to_log_map)); |
1273 |
|
for (i = 0; i < pointer_buttons; ++i) |
1274 |
|
{ |
1275 |
|
/* This might produce multiple logical buttons mapping |
1276 |
|
to a single physical one, but hey, that's |
1277 |
|
life... */ |
1278 |
|
g_pointer_log_to_phys_map[phys_to_log_map[i] - 1] = i + 1; |
1279 |
|
} |
1280 |
|
} |
1281 |
|
|
1282 |
RD_BOOL |
RD_BOOL |
1283 |
get_key_state(unsigned int state, uint32 keysym) |
get_key_state(unsigned int state, uint32 keysym) |
1284 |
{ |
{ |
1633 |
g_width = (g_width + 3) & ~3; |
g_width = (g_width + 3) & ~3; |
1634 |
|
|
1635 |
g_mod_map = XGetModifierMapping(g_display); |
g_mod_map = XGetModifierMapping(g_display); |
1636 |
|
xwin_refresh_pointer_map(); |
1637 |
|
|
1638 |
xkeymap_init(); |
xkeymap_init(); |
1639 |
|
|
1897 |
{ |
{ |
1898 |
uint16 button, flags = 0; |
uint16 button, flags = 0; |
1899 |
g_last_gesturetime = xevent.xbutton.time; |
g_last_gesturetime = xevent.xbutton.time; |
1900 |
|
/* Reverse the pointer button mapping, e.g. in the case of |
1901 |
|
"left-handed mouse mode"; the RDP session expects to |
1902 |
|
receive physical buttons (true in mstsc as well) and |
1903 |
|
logical button behavior depends on the remote desktop's own |
1904 |
|
mouse settings */ |
1905 |
|
xevent.xbutton.button = g_pointer_log_to_phys_map[xevent.xbutton.button - 1]; |
1906 |
button = xkeymap_translate_button(xevent.xbutton.button); |
button = xkeymap_translate_button(xevent.xbutton.button); |
1907 |
if (button == 0) |
if (button == 0) |
1908 |
return; |
return; |
2190 |
XFreeModifiermap(g_mod_map); |
XFreeModifiermap(g_mod_map); |
2191 |
g_mod_map = XGetModifierMapping(g_display); |
g_mod_map = XGetModifierMapping(g_display); |
2192 |
} |
} |
2193 |
|
|
2194 |
|
if (xevent.xmapping.request == MappingPointer) |
2195 |
|
{ |
2196 |
|
xwin_refresh_pointer_map(); |
2197 |
|
} |
2198 |
|
|
2199 |
break; |
break; |
2200 |
|
|
2201 |
/* clipboard stuff */ |
/* clipboard stuff */ |