-
Notifications
You must be signed in to change notification settings - Fork 163
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Space bar in debugger. AppleWin 1.27.5.0 Windows 10 32bit #570
Comments
Hi Marco, I tried with 1.27.5.0 (on Win7-64), and I experience a lag when I hold down SPACE to do repeated stepping. What happens, is when I release SPACE, then the debugger will do a few more steps before stopping. If I disable the hook filter, then the debugger keeps up with the SPACE keyboard repeat. Can you try disabling the hook filter: |
I tried the -no-hook-system-key switch but the debugger continues to stop ~3÷5 lines after releasing the key. I could be wrong but the delay seems to me to be proportional to the time I hold the space bar, for this reason I said "buffer" Marco |
OK, on the second try the switch works like you said. Marco |
No trouble, and thanks for taking the time to raise this issue. btw. I guess the first time you mis-spelt the switch - if you enable logging (-log or -l) then the log will report unsupported switches (ie. indicating a mis-spelling). |
My notes:
|
NB, using 1.27.5.0:
|
I'm a bit stumped by this situation of it working on one PC, but not another. Maybe on the VAIO some other process is adding a hook filter to the chain which is causing this slowdown? If so then it's outside of the AppleWin process's control. One option is to unhook the filter when entering MODE_DEBUG, and re-hook the filter on leaving that mode. I did some simple timings of 10,000 calls to just UnhookWindowsHookEx()/SetWindowsHookEx() (on both VAIO and Phenom) and the time was 16ms, ie each call is ~1us. So it's a very lightweight operation to do. |
From MSDN: LowLevelKeyboardProc callback function
So I tried creating a dedicated HookThread, installed the hook filter from this thread and then had a 2nd simple message loop in this thread: Get()/Translate()/Dispatch(). This seems to fix the lag. So I suspect that the time in the hook filter + time to render AppleWin's debugger display was greater than the keyboard repeat interval, so over time there'd be an increased delay (ie. lag) in processing the WM_KEYDOWN messages. |
. Created a dedicated thread with message loop (#570) HookFilter dll: Only call GetKeyState() if keycode is ESC (instead of every time) DebuggerCursorUpdate(): reduce sleep from 10ms to 1ms
Confirmed that this (97b07ea) fixes the lag issue on the VAIO, and continues to be fine on the Phenom II. |
@MarcoVerpelli - can you try this build of AppleWin 1.27.6 ? |
The debugger is back to work as expected. |
Thanks for checking this. FTR, I've also checked on:
|
Now I have to use the -no-hook-system-key option to be able to enter, for example, the # character. Damn nationalized keyboards # corresponds to AltGr + à, AltGr is the Alt key to the right of the space bar. Also if I double click on a disk image, AppleWin obviously starts without the -no-hook-system-key option. and it is impossible to insert the # symbols. |
So how do you normally type a # character? NB. For me (on my UK keyboard), AltGr+a gives me á. And I have a key dedicated to # (with a ~ available when I press shift and that key). Was the previous AppleWin 1.27.5.0 OK for you when typing a # character? |
AltGr + à is the normal way With 1.27.5.0 the only issue I had was with the debugger, absolutely no problem with the keyboard. |
I see, thanks. And Wikipedia shows this too, here. There isn't much demand for ClosedApple+<key>, so maybe I'll provide a GUI option for opting in to this new 1.27.6 behaviour, and revert so that the default is like 1.27.5 (and earlier). |
I could bore you for hours telling about my problems in the 80s. In short: WordPerfect on PC/DOS a person had to write commercial letters in Cyrillic, a nightmare! |
FYI, there's a new 1.27.7 release here with the hooked ALT GR's fake LEFT CONTROL reverted. |
Thanks a lot, no problem with the debugger or with the keyboard. |
Thanks for checking this version. |
I think that with the last changes in the management of the keyboard an annoying bug has been inserted.
The keyboard buffer is active in the debugger so it is almost impossible for me to repeatedly press the space bar to step in to the code.
Thank you
Marco
The text was updated successfully, but these errors were encountered: