|
13 | 13 | #include "systemtray.h" |
14 | 14 |
|
15 | 15 | /* |
16 | | - * *NOT IT* The idea here is to use keybd_event() instead of SendInput() to avoid the problem of |
17 | | - * some (games in particular) applications not responding well to SendInput() while |
18 | | - * also playing nice with the previous code written for SendInput |
19 | | - * https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-keybd_event |
20 | | - * |
21 | | - * HAS THE SAME ISSUE |
22 | | - * The games might be monitoring the status of LLKHF_INJECTED and ignoring it. |
23 | | - * Modify this flag in the llkeyboardproc if it is our custom release keys? |
24 | | - * |
25 | | - * As written in "Practical Video Game Bots: Automating Game Processes..." by Ilya Shpigor p.g. 90: |
26 | | - * "All keyboard events, which are produced by the SendInput and keybd_event WinAPI functions, have |
27 | | - * the LLKHF_INJECTED flag in the KBDLLHOOKSTRUCT structure. One the other hand, keyboard events, |
28 | | - * which are produced by a keyboard driver, do not have this flag. This flag is set on the Windows |
29 | | - * kernel level, and it is impossible to disable the flag on the WinAPI level." |
30 | | - * |
31 | | - * We have some possibilities in that we could create a virtual keyboard driver for our application |
32 | | - * or patch the windows kernel. However, these are pretty extreme for our purposes and would likely |
33 | | - * not play well with some anticheats. If we really wanted to remove this flag we could attempt to |
34 | | - * do so in llkeyboardproc as noted earlier. However, this may not fix the issue either as: |
35 | | - * |
36 | | - * *NOT IT* SendInput and keybd_event are susceptible to User Interface Privilege Isolation (UIPI). An |
| 16 | + * SendInput and keybd_event are susceptible to User Interface Privilege Isolation (UIPI). An |
37 | 17 | * application running at a higher integrity level than an application calling SendInput will |
38 | 18 | * not receive this input. |
39 | | - * |
40 | | - * Also I have seen reports that using scancode instead of the virtual keycode could fix the |
41 | | - * keyup not registering problem. See the keybd_event microsoft docs for more. |
42 | | - * https://www.win.tue.nl/~aeb/linux/kbd/scancodes-1.html |
43 | | - * for a list of scancodes (1.4 ordinary scancodes) section |
44 | | - * *THIS WAS IT* |
| 19 | + * Maybe run AutoRun with administrator permissions if it doesn't work with some apps? |
45 | 20 | */ |
46 | 21 |
|
47 | | -/* |
48 | | - * TODO Known Issues: |
49 | | - * - games like Minecraft that rely more on the actual key up and key down messages rather than key repeats |
50 | | - * still hold the keys even when repeating is done (must manually press the held key and release to stop holding) |
51 | | - * - note: I now think that the game is just not listening to our key events and the only reason |
52 | | - * it is holding the keys is because we consumed the key up event |
53 | | - */ |
54 | 22 | #ifdef AUTORUN_DEBUG |
55 | 23 | // can use these as well: __FILE__, __LINE__ and __func__ |
56 | 24 | #define log(x, ...) printf(x, __VA_ARGS__) |
@@ -144,7 +112,7 @@ void disable_hold_task() { |
144 | 112 | delete[] inputsBuffer; |
145 | 113 | holdTask = NULL; |
146 | 114 |
|
147 | | - // must zero memory here because we do not track key events whilst this task is enabled TODO may not be necessary |
| 115 | + // zero memory here because we do not track key events whilst this task is enabled (not entirely necessary as we run this synchronously with llkeyboardproc) |
148 | 116 | memset(KEY_STATES, 0, KEY_STATE_BUFFER_SIZE); |
149 | 117 | log("toggled off\n"); |
150 | 118 | } |
|
0 commit comments