aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/devdraw/x11-screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/devdraw/x11-screen.c')
-rw-r--r--src/cmd/devdraw/x11-screen.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/src/cmd/devdraw/x11-screen.c b/src/cmd/devdraw/x11-screen.c
index 9490ab8f..f4aa1ce9 100644
--- a/src/cmd/devdraw/x11-screen.c
+++ b/src/cmd/devdraw/x11-screen.c
@@ -376,6 +376,7 @@ runxevent(XEvent *xev)
if(w == nil)
w = _x.windows;
+ int shift;
switch(xev->type){
case Expose:
_xexpose(w, xev);
@@ -406,7 +407,10 @@ runxevent(XEvent *xev)
case MotionNotify:
if(_xtoplan9mouse(w, xev, &m) < 0)
return;
- gfx_mousetrack(w->client, m.xy.x, m.xy.y, m.buttons|_x.kbuttons, m.msec);
+ shift = 0;
+ if(_x.kstate & ShiftMask)
+ shift = 5;
+ gfx_mousetrack(w->client, m.xy.x, m.xy.y, (m.buttons|_x.kbuttons)<<shift, m.msec);
break;
case KeyRelease:
@@ -440,32 +444,41 @@ runxevent(XEvent *xev)
case XK_Alt_L:
case XK_Alt_R:
kcodealt = ke->keycode;
- // fall through
+ c |= Mod1Mask;
+ modp = 1;
+ break;
case XK_Shift_L:
case XK_Shift_R:
kcodeshift = ke->keycode;
- c |= Mod1Mask;
+ c |= ShiftMask;
modp = 1;
+ break;
}
else {
if(ke->keycode == kcodecontrol){
c &= ~ControlMask;
modp = 1;
- } else if(ke->keycode == kcodealt || ke->keycode == kcodeshift){
+ } else if(ke->keycode == kcodealt){
c &= ~Mod1Mask;
modp = 1;
+ } else if(ke->keycode == kcodeshift) {
+ c &= ~ShiftMask;
+ modp = 1;
}
}
if(modp){
_x.kstate = c;
if(m.buttons || _x.kbuttons) {
+ int shift = 0;
_x.altdown = 0; // used alt
_x.kbuttons = 0;
if(c & ControlMask)
_x.kbuttons |= 2;
if(c & Mod1Mask)
_x.kbuttons |= 4;
- gfx_mousetrack(w->client, m.xy.x, m.xy.y, m.buttons|_x.kbuttons, m.msec);
+ if(c & ShiftMask)
+ shift = 5;
+ gfx_mousetrack(w->client, m.xy.x, m.xy.y, (m.buttons|_x.kbuttons)<<shift, m.msec);
}
modp = 0;
}