Lines 1-25
Link Here
|
1 |
--- src/xlib/main.c.orig 2016-07-26 23:53:18 UTC |
1 |
--- src/xlib/main.c.orig 2016-12-21 09:12:44 UTC |
2 |
+++ src/xlib/main.c |
2 |
+++ src/xlib/main.c |
3 |
@@ -73,8 +73,9 @@ void postmessage(uint32_t msg, uint16_t |
3 |
@@ -35,7 +35,9 @@ void postmessage(uint32_t msg, uint16_t |
4 |
XFlush(display); |
4 |
XFlush(display); |
5 |
} |
5 |
} |
6 |
|
6 |
|
7 |
- |
|
|
8 |
+#ifdef __LINUX__ |
7 |
+#ifdef __LINUX__ |
9 |
#include <linux/input.h> |
8 |
#include <linux/input.h> |
10 |
+#endif |
9 |
+#endif |
11 |
FILE *ptt_keyboard_handle; |
10 |
FILE * ptt_keyboard_handle; |
12 |
Display *ptt_display; |
11 |
Display *ptt_display; |
13 |
void init_ptt(void){ |
12 |
void init_ptt(void) { |
14 |
@@ -100,6 +101,7 @@ _Bool check_ptt_key(void){ |
13 |
@@ -60,6 +62,7 @@ bool check_ptt_key(void) { |
15 |
int ptt_key; |
14 |
int ptt_key; |
16 |
|
15 |
|
17 |
/* First, we try for direct access to the keyboard. */ |
16 |
/* First, we try for direct access to the keyboard. */ |
18 |
+#ifdef __LINUX__ |
17 |
+#ifdef __LINUX__ |
19 |
ptt_key = KEY_LEFTCTRL; // TODO allow user to change this... |
18 |
ptt_key = KEY_LEFTCTRL; // TODO allow user to change this... |
20 |
if (ptt_keyboard_handle) { |
19 |
if (ptt_keyboard_handle) { |
21 |
/* Nice! we have direct access to the keyboard! */ |
20 |
/* Nice! we have direct access to the keyboard! */ |
22 |
@@ -117,6 +119,7 @@ _Bool check_ptt_key(void){ |
21 |
@@ -78,6 +81,7 @@ bool check_ptt_key(void) { |
23 |
return 0; |
22 |
return 0; |
24 |
} |
23 |
} |
25 |
} |
24 |
} |
Lines 26-29
Link Here
|
26 |
+#endif |
25 |
+#endif |
27 |
/* Okay nope, lets' fallback to xinput... *pouts* |
26 |
/* Okay nope, lets' fallback to xinput... *pouts* |
28 |
* Fall back to Querying the X for the current keymap. */ |
27 |
* Fall back to Querying the X for the current keymap. */ |
29 |
ptt_key = XKeysymToKeycode(display, XK_Control_L); |
28 |
ptt_key = XKeysymToKeycode(display, XK_Control_L); |