Skip to content
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

cannot generate SHIFT+CONTROL+<any key> and CONTROL+<arrow> events #230

Open
polijan opened this issue Oct 15, 2022 · 1 comment
Open

cannot generate SHIFT+CONTROL+<any key> and CONTROL+<arrow> events #230

polijan opened this issue Oct 15, 2022 · 1 comment

Comments

@polijan
Copy link

polijan commented Oct 15, 2022

I was using some CPC software that expected CTRL + arrow keys. Unfortunately, I'm not able to generate such keyboard events in Caprice32. I do not believe this is an issue with my keymap.

I also realized any press of SHIFT+CONTROL+ is also not generating anything.

The virtual keyboard is also not able to help me.


The following BASIC program might be useful to check the control+ issue:

10 IF INKEY(0)<>128 THEN 10:' press ctrl+up arrow to exit

The following BASIC program might be useful to check the control+shift+ issue:

10 IF INKEY(55)<>160 THEN 10:' press shift+ctrl+v to exit
ColinPitrat added a commit that referenced this issue Oct 16, 2022
@ColinPitrat
Copy link
Owner

Yeah that's #151. I added support for CTRL + cursor.

It's easy to add more combinations but I'm not sure the path I chose for #151 is the right way to support all of them.

The keyboard handling has basically three layers:

  • SDL key codes
  • Caprice key codes
  • CPC key codes

Control and shift are considered as modifiers in SDL key code and are also considered as modifiers in CPC key codes, but not in Caprice translation layer in-between. The reason for that is that depending on the keyboard, you may have to type a modifier on the host to get a non-modified CPC key (e.g. ':' requires typing shift on a modern keyboard but didn't on a CPC).

This means that however we support it, as long as we use logical mapping[1] rather than physical mapping[2], some key combinations won't be possible (e.g. SHIFT+':').

I'll keep #151 to support more key combinations. Add some info there if you need some. I'd need to do some redesign (e.g. allow includes in keymap, have a single entry fully filled in cpc_kbd with only the differences being patched for fr & es) to make things a bit easier.

[1] what you type on your host keyboard is what the CPC receives in input. For example you type ':', the CPC receives ':'
[2] the key you type on you keyboard is mapped to a CPC key based on it's position on the keyboard, not what it actually corresponds to. For example, you type the key right to L (';' on a QWERTY keyboard) to type a ':' on the CPC.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants