Dotneteer/spectnetide

[FEATURE REQUEST] capture L/R arrow cursor keys in emulator

Closed this issue · 8 comments

nww02 commented

The Up and Down cursor keys appear to be captured by the emulator, but the Left / Right cursor keys do not seem to. When pressing left and right arrow, the focus shifts away from the emulator to other windows.

I did not manage to reproduce this behavior in my computer :-(. I wrote this short basic program to test the emulator window, and it worked just as I expected:

10 LET a$ = INKEY$
20 IF a$ = "" GO TO 10
30 PRINT CODE a$
40 GO TO 10

When running this code, it prints "8" for left, and "9" for right, so it translates the key codes properly, as this screenshot indicates (and it does not change the focus).

devenv_TVXWmIGhx5

Probably, I'm missing something. Perhaps, it's somethig with your keyboard layout or language settings...

nww02 commented

Hmm, to reproduce, try this:-

TYPE a multiline program (10 PRINT "Hello" 20 GO TO 10 will do it :) )
LIST your program
Try to use the cursor arrows to go up and down lines
EDIT a line
Try to use the cursor arrows to go left and right along the line.

On my (UK english) keyboard, I can go up and down but when I try to edit side-to-side, the VS focus just shifts to a panel that's to the left or right of the emulator window... Similarly when I am using software that uses < and > arrows, they just shift focus out.

I suspect what the issue is :-).

I guess you are using the ZX Spectrum Keyboard to press EDIT. After that, the focus shifts to the ZX Spectrum Keyboard Tool window. If now you press either LEFT or RIGHT, that moves the focus around the windows open in the IDE. First, you have to click the ZX Spectrum Emulator tool window to get the focus, and then, it accepts left and right arrow keys.

I check, if I can automatically put back the focus to the ZX Spectrum Emulator window after you click a key in the ZX Spectrum Keyboard.

Putting back the focus to the ZX Spectrum Emulator window works now. You can check it in this private build:

Spect.Net.VsPackage.zip

nww02 commented

Yes, the focus shifts to the keyboard. However, when I move focus manually back to the emulator, the L and R keys still move focus out of the emulator.

I made a video to show it happening.. This is with the build you sent me to test the macro fixup enhancement... I see that focus instantly shifts back to the emulator when I click EDIT, so I assume that the fixup build includes the above update as well? However, the L and R arrows still only work if there's no panel to the left or right of the emulator. If there is, the focus shifts....

https://youtu.be/hj_UnZwGMak

Sorry for my silence, I was pretty busy during this week. Your video managed to identify the issue (the left and right keys did work for document windows, but not for tool windows), and I fixed it.
I release Preview 6 today, and that will include this fix, too.

Released in v2 Preview 6.

nww02 commented

Thanks for this. It was a pain editing code with the on-screen keyboard! As you've been fixing these issues, I've been slowly able to use the onscreen keyboard less and less, which I think will help future developers as well.

Thank you for your responsiveness and for considering these crazy issues! Have a great weekend :)