mirror of
https://github.com/gnustep/libs-back.git
synced 2025-02-23 20:01:22 +00:00
Handle horizontal scrolling in X11
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@29532 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
77565aaad0
commit
39c9297595
4 changed files with 40 additions and 9 deletions
|
@ -1,3 +1,9 @@
|
||||||
|
2010-02-10 Eric Wasylishen <ewasylishen@gmail.com>
|
||||||
|
|
||||||
|
* Source/x11/XGServerWindow.m:
|
||||||
|
* Source/x11/XGServerEvent.m:
|
||||||
|
* Headers/x11/XGGeneric.h: Handle horizontal scrolling events
|
||||||
|
|
||||||
2010-02-07 03:37-EST Gregory John Casamento <greg.casamento@gmail.com>
|
2010-02-07 03:37-EST Gregory John Casamento <greg.casamento@gmail.com>
|
||||||
|
|
||||||
* Headers/win32/WIN32Server.h: Remove HOTKEY method.
|
* Headers/win32/WIN32Server.h: Remove HOTKEY method.
|
||||||
|
|
|
@ -117,6 +117,8 @@ struct XGGeneric {
|
||||||
unsigned char rMouse;
|
unsigned char rMouse;
|
||||||
unsigned char upMouse;
|
unsigned char upMouse;
|
||||||
unsigned char downMouse;
|
unsigned char downMouse;
|
||||||
|
unsigned char scrollLeftMouse;
|
||||||
|
unsigned char scrollRightMouse;
|
||||||
int lMouseMask;
|
int lMouseMask;
|
||||||
int mMouseMask;
|
int mMouseMask;
|
||||||
int rMouseMask;
|
int rMouseMask;
|
||||||
|
|
|
@ -402,6 +402,7 @@ posixFileDescriptor: (NSPosixFileDescriptor*)fileDescriptor
|
||||||
}
|
}
|
||||||
generic.lastClick = xEvent.xbutton.time;
|
generic.lastClick = xEvent.xbutton.time;
|
||||||
[self setLastTime: generic.lastClick];
|
[self setLastTime: generic.lastClick];
|
||||||
|
deltaX = 0.0;
|
||||||
deltaY = 0.0;
|
deltaY = 0.0;
|
||||||
|
|
||||||
if (xEvent.xbutton.button == generic.lMouse)
|
if (xEvent.xbutton.button == generic.lMouse)
|
||||||
|
@ -435,6 +436,20 @@ posixFileDescriptor: (NSPosixFileDescriptor*)fileDescriptor
|
||||||
eventType = NSScrollWheel;
|
eventType = NSScrollWheel;
|
||||||
buttonNumber = generic.downMouse;
|
buttonNumber = generic.downMouse;
|
||||||
}
|
}
|
||||||
|
else if (xEvent.xbutton.button == generic.scrollLeftMouse
|
||||||
|
&& generic.scrollLeftMouse != 0)
|
||||||
|
{
|
||||||
|
deltaX = -1.;
|
||||||
|
eventType = NSScrollWheel;
|
||||||
|
buttonNumber = generic.scrollLeftMouse;
|
||||||
|
}
|
||||||
|
else if (xEvent.xbutton.button == generic.scrollRightMouse
|
||||||
|
&& generic.scrollRightMouse != 0)
|
||||||
|
{
|
||||||
|
deltaX = 1.;
|
||||||
|
eventType = NSScrollWheel;
|
||||||
|
buttonNumber = generic.scrollRightMouse;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
break; /* Unknown button */
|
break; /* Unknown button */
|
||||||
|
@ -484,7 +499,7 @@ posixFileDescriptor: (NSPosixFileDescriptor*)fileDescriptor
|
||||||
clickCount: clickCount
|
clickCount: clickCount
|
||||||
pressure: 1.0
|
pressure: 1.0
|
||||||
buttonNumber: buttonNumber /* FIXME */
|
buttonNumber: buttonNumber /* FIXME */
|
||||||
deltaX: 0.
|
deltaX: deltaX
|
||||||
deltaY: deltaY
|
deltaY: deltaY
|
||||||
deltaZ: 0.];
|
deltaZ: 0.];
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1295,13 +1295,15 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
|
||||||
- (void) _setupMouse
|
- (void) _setupMouse
|
||||||
{
|
{
|
||||||
int numButtons;
|
int numButtons;
|
||||||
unsigned char mouseNumbers[5];
|
unsigned char mouseNumbers[7];
|
||||||
unsigned char buttons[5] = {
|
unsigned char buttons[7] = {
|
||||||
Button1,
|
Button1,
|
||||||
Button2,
|
Button2,
|
||||||
Button3,
|
Button3,
|
||||||
Button4,
|
Button4,
|
||||||
Button5
|
Button5,
|
||||||
|
6,
|
||||||
|
7
|
||||||
};
|
};
|
||||||
int masks[5] = {
|
int masks[5] = {
|
||||||
Button1Mask,
|
Button1Mask,
|
||||||
|
@ -1314,15 +1316,21 @@ _get_next_prop_new_event(Display *display, XEvent *event, char *arg)
|
||||||
* Get pointer information - so we know which mouse buttons we have.
|
* Get pointer information - so we know which mouse buttons we have.
|
||||||
* With a two button
|
* With a two button
|
||||||
*/
|
*/
|
||||||
numButtons = XGetPointerMapping(dpy, mouseNumbers, 5);
|
numButtons = XGetPointerMapping(dpy, mouseNumbers, 7);
|
||||||
if (numButtons > 5)
|
if (numButtons > 7)
|
||||||
{
|
{
|
||||||
NSDebugLLog(@"XGTrace", @"Warning - mouse/pointer seems to have more than 5 buttons "
|
NSDebugLLog(@"XGTrace", @"Warning - mouse/pointer seems to have more than 7 buttons "
|
||||||
@"(%d) - just using one to five", numButtons);
|
@"(%d) - just using one to seven", numButtons);
|
||||||
numButtons = 5;
|
numButtons = 7;
|
||||||
}
|
}
|
||||||
generic.lMouse = buttons[0];
|
generic.lMouse = buttons[0];
|
||||||
generic.lMouseMask = masks[0];
|
generic.lMouseMask = masks[0];
|
||||||
|
if (numButtons >= 7)
|
||||||
|
{
|
||||||
|
generic.scrollLeftMouse = buttons[5];
|
||||||
|
generic.scrollRightMouse = buttons[6];
|
||||||
|
}
|
||||||
|
|
||||||
if (numButtons >= 5)
|
if (numButtons >= 5)
|
||||||
{
|
{
|
||||||
generic.upMouse = buttons[3];
|
generic.upMouse = buttons[3];
|
||||||
|
|
Loading…
Reference in a new issue