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

Fix issue 89 #91

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fix issue 89 #91

wants to merge 2 commits into from

Conversation

cookiengineer
Copy link
Contributor

@cookiengineer cookiengineer commented Jan 30, 2018

Because it was impossible to follow what was going on, this pull-request contains a re-layout of the inlined matrix in chunks of 32 (8x4), so that later indexes that need to be replaced can be easily counted through.

The below code already fixes:

  • insert key fires 45
  • delete key fires 46
  • F1-F12 fire 112 to 123
  • 9 fires 57
  • , fires 188
  • - fires 189
  • . fires 190
  • ... fires 192 (key described is the one left of 1, shitty github markdown, yo)
  • [ fires 219
  • \ fires 220
  • ] fires 221
  • ' fires 222

The current way of translating keys between ranges isn't failsafe. Currently these keycodes cannot be fixed:

  • ; fires 186, position is array index 58
  • = fires 187, position is array index 60
  • / fires 191, position is array index 46

The reason why this currently cannot be fixed is that the code in the UIInterface assumes that keycodes that are lower than 127 are always a 1:1 mapping; which isn't the case for these three keys.

Actually these three keys are the only cases where this doesn't apply, as the rest of the keyboard (speaking of 105/106 keys) works perfectly, including all special keys except Fn on laptops, but that's okay.

I guess in order to complete this, I need to talk with @paraboul on how to solve this properly. Either use the complete matrix in every case (so add all keycodes below 127 in it, too); or make some if/else comparisons inside UIInterface regarding SDL special characters, because the translation bitshift is wrong in above three cases - so they need to be done before the matrix lookup.

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

Successfully merging this pull request may close these issues.

1 participant