summaryrefslogtreecommitdiffstats
path: root/src/cmd/devdraw
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/devdraw')
-rw-r--r--src/cmd/devdraw/mac-screen.m10
-rw-r--r--src/cmd/devdraw/x11-screen.c23
2 files changed, 27 insertions, 6 deletions
diff --git a/src/cmd/devdraw/mac-screen.m b/src/cmd/devdraw/mac-screen.m
index 6abdee11..c5760ddc 100644
--- a/src/cmd/devdraw/mac-screen.m
+++ b/src/cmd/devdraw/mac-screen.m
@@ -635,15 +635,15 @@ rpc_resizewindow(Client *c, Rectangle r)
x = 0;
if(m & ~omod & NSEventModifierFlagControl)
x = 1;
- if(m & ~omod & NSEventModifierFlagOption)
- x = 2;
if(m & ~omod & NSEventModifierFlagCommand)
+ x = 2;
+ if(m & ~omod & NSEventModifierFlagOption)
x = 4;
b |= x;
if(m & NSEventModifierFlagShift)
b <<= 5;
[self sendmouse:b];
- }else if(m & ~omod & NSEventModifierFlagOption)
+ }else if(m & ~omod & NSEventModifierFlagCommand)
gfx_keystroke(self.client, Kalt);
omod = m;
@@ -700,11 +700,11 @@ rpc_resizewindow(Client *c, Rectangle r)
m = [e modifierFlags];
if(b == 1){
- if(m & NSEventModifierFlagOption){
+ if(m & NSEventModifierFlagCommand){
gfx_abortcompose(self.client);
b = 2;
}else
- if(m & NSEventModifierFlagCommand)
+ if(m & NSEventModifierFlagOption)
b = 4;
}
if(m & NSEventModifierFlagShift)
diff --git a/src/cmd/devdraw/x11-screen.c b/src/cmd/devdraw/x11-screen.c
index 7fa86ddf..8475690b 100644
--- a/src/cmd/devdraw/x11-screen.c
+++ b/src/cmd/devdraw/x11-screen.c
@@ -12,6 +12,7 @@
#include <thread.h>
#include "x11-memdraw.h"
#include "devdraw.h"
+#include "keyboard-extras.h"
#undef time
@@ -1277,12 +1278,32 @@ _xtoplan9kbd(XEvent *e)
if(k == XK_hyphen)
k = XK_minus;
/* Do control mapping ourselves if translator doesn't */
- if(e->xkey.state&ControlMask)
+ if(e->xkey.state&ControlMask) {
k &= 0x9f;
+ if (k == '\n')
+ k = Kcret;
+ }
if(k == NoSymbol) {
return -1;
}
+ /* Mod4 + key */
+ if(e->xkey.state&Mod4Mask)
+ k += Kmod4;
+
+ /* Shift modified bindings */
+ if(e->xkey.state&ShiftMask) {
+ /* Ctrl + Shift + Key, Shift + Left/Right/Delete */
+ if(k == Kleft
+ || k == Kright
+ || k == Kdel
+ || k == Kup
+ || k == Kdown
+ || k == Kcret
+ || e->xkey.state&ControlMask)
+ k += Ksh;
+ }
+
return k+0;
}