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

Greek accent / dead key support #815

Closed
wants to merge 1 commit into from

Conversation

tenextractor
Copy link
Contributor

@tenextractor tenextractor commented May 28, 2024

Fix #760. Dead keys can be used in any JSON layout, by adding "isDeadKey": true to a key containing an accent character, for example { "label": "´", "isDeadKey": true }.
Unfortunately it's not perfect.
Issues:

  1. To get ΐ, ¨´ι must be typed in that order. ´¨ι does not work. Same with ΰ.
  2. Capital versions Ϊ́ and Ϋ́ do not work, they have to be typed with popup keys.

@Helium314
Copy link
Owner

Adding a property that cannot ever be valid is not a reasonable approach.
Whether the character should be treated as dead key is something that can be inferred from the code. I haven't looked in detail, but unicode modifier letters seems to be the right category.
Maybe codes need to be translated to work with the dead key combiner, maybe there is already useful code regarding this somewhere near where createDeadEvent is currently called.

@tenextractor
Copy link
Contributor Author

tenextractor commented Jun 2, 2024

Adding a property that cannot ever be valid is not a reasonable approach.

If you don't mind can you explain this a bit more? I don't understand what you mean by 'cannot ever be valid'.

Whether the character should be treated as dead key is something that can be inferred from the code. I haven't looked in detail, but unicode modifier letters seems to be the right category.

Unfortunately there are languages that do use modifier letters as actual characters, for example Skolt Sami which uses Modifier Letter Prime (U+02B9). I don't think it's something we can infer from the code itself. Ideally the keyboard should be able to output any character, so automatically intercepting some characters will make this impossible. This is why I think a good solution would be to mark a key as a dead key in some way. If adding that to the keyboard JSON is not reasonable, please suggest a better way to do it.

@Helium314
Copy link
Owner

Alright, then we can use the normal characters for combining (like on a hardware keyboard).

If you don't mind can you explain this a bit more? I don't understand what you mean by 'cannot ever be valid'.

Sorry, I wasn't clear here, it depends on the key. If you have a b and declare it a dead key, it still cannot be a valid dead key in the normal sense.

@tenextractor
Copy link
Contributor Author

tenextractor commented Jun 5, 2024

I don't know what exactly you mean by 'normal' characters, but if you mean characters such as ^, ~ and ` (in ASCII), the keyboard has to be able to input them independently so we can't automatically intercept them.

We can add a check as to which characters can be dead keys, but I don't think it is critical, because we can ensure that only correct keys are dead keys in our built in layouts, and even if someone makes an invalid key as a dead key in a custom layout, it doesn't have any effects like crashing the program, it only inverts the order of input.
For example if b is a dead key, then entering ba will output ab.

However I will look into checking for invalid dead keys.

@tenextractor
Copy link
Contributor Author

Added a check for invalid dead keys.

@tenextractor
Copy link
Contributor Author

Any update on this?

@tenextractor
Copy link
Contributor Author

Seems like in the code, any key with a combining accent code in a physical keyboard layout is treated as a dead key, I will modify this to do the same.

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.

Add dedicated accent key for Greek
2 participants