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

improve psychHID cookedKey on windows #373

Closed
dcnieho opened this issue Sep 13, 2016 · 2 comments
Closed

improve psychHID cookedKey on windows #373

dcnieho opened this issue Sep 13, 2016 · 2 comments
Assignees

Comments

@dcnieho
Copy link
Member

dcnieho commented Sep 13, 2016

As it is now, the cookedKey ignores the state of capslock, as well as the right alt modifier as used in e.g. Swedish and German. As far as i can see, the state of these can be provided to ToAsciiEx, like is already done for shift. Shall I implement this? I see no backward compatibility problems, the cookedKey field will simply be correct in more cases (it is meant to provide a guess of the typed character after all, and it does a pretty good job usually).

Two further improvements i would like are:

  • when ToAsciiEx puts more than one character into the buffer, provide the last in the cookedKey return instead of ignoring as is done now. The second of the two characters put in the buffer matches the key-press of the second keypress. Two keys are put in the buffer if there was a dead key pressed before, but the current keypress could not compose with it. This change should not have backward compatibility concerns, it again leads to correct output in more corner cases.
  • still provide cookedKey if a dead key (e.g. a diacritic) is pressed. It would however be necessary to indicate somehow that this is a dead key. Since the cookedEventCode field is an int, perhaps this could be indicated by negating the returned cookedEventCode. This would of course have to be default-off, enabled by the user setting a preference.

I'd be happy to implement all four items a.s.a.p., go on all four?

@kleinerm
Copy link

Sounds all reasonable. Except for last point of returning dead keys like diacritic's. What would be the value of that?

@kleinerm
Copy link

I think this is done with latest PTB beta, so closing.

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

No branches or pull requests

2 participants