LEFT | RIGHT |
(no file at all) | |
1 /* input event and data structure translation */ | 1 /* input event and data structure translation */ |
2 | 2 |
3 #include <u.h> | 3 #include <u.h> |
4 #include "x11-inc.h" | 4 #include "x11-inc.h" |
5 #ifdef __APPLE__ | 5 #ifdef __APPLE__ |
6 #define APPLESNARF | 6 #define APPLESNARF |
7 #define Boolean AppleBoolean | 7 #define Boolean AppleBoolean |
8 #define Rect AppleRect | 8 #define Rect AppleRect |
9 #define EventMask AppleEventMask | 9 #define EventMask AppleEventMask |
10 #define Point ApplePoint | 10 #define Point ApplePoint |
(...skipping 19 matching lines...) Expand all Loading... |
30 static KeySym | 30 static KeySym |
31 __xtoplan9kbd(XEvent *e) | 31 __xtoplan9kbd(XEvent *e) |
32 { | 32 { |
33 KeySym k; | 33 KeySym k; |
34 | 34 |
35 if(e->xany.type != KeyPress) | 35 if(e->xany.type != KeyPress) |
36 return -1; | 36 return -1; |
37 needstack(64*1024); /* X has some *huge* buffers in openobject */ | 37 needstack(64*1024); /* X has some *huge* buffers in openobject */ |
38 /* and they're even bigger on SuSE */ | 38 /* and they're even bigger on SuSE */ |
39 XLookupString((XKeyEvent*)e,NULL,0,&k,NULL); | 39 XLookupString((XKeyEvent*)e,NULL,0,&k,NULL); |
40 » if(k == k == NoSymbol) | 40 » if(k == NoSymbol) |
41 return -1; | 41 return -1; |
42 | 42 |
43 if(k&0xFF00){ | 43 if(k&0xFF00){ |
44 switch(k){ | 44 switch(k){ |
45 case XK_BackSpace: | 45 case XK_BackSpace: |
46 case XK_Tab: | 46 case XK_Tab: |
47 case XK_Escape: | 47 case XK_Escape: |
48 case XK_Delete: | 48 case XK_Delete: |
49 case XK_KP_0: | 49 case XK_KP_0: |
50 case XK_KP_1: | 50 case XK_KP_1: |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 e.window = e.root; | 715 e.window = e.root; |
716 e.subwindow = None; | 716 e.subwindow = None; |
717 e.x = e.x_root; | 717 e.x = e.x_root; |
718 e.y = e.y_root; | 718 e.y = e.y_root; |
719 #undef time | 719 #undef time |
720 e.time = CurrentTime; | 720 e.time = CurrentTime; |
721 XUngrabPointer(_x.display, m->msec); | 721 XUngrabPointer(_x.display, m->msec); |
722 XSendEvent(_x.display, e.root, True, ButtonPressMask, (XEvent*)&e); | 722 XSendEvent(_x.display, e.root, True, ButtonPressMask, (XEvent*)&e); |
723 XFlush(_x.display); | 723 XFlush(_x.display); |
724 } | 724 } |
LEFT | RIGHT |