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

Handle special negative values in codePoints #1377

Open
Noneangel opened this issue Feb 19, 2025 · 0 comments
Open

Handle special negative values in codePoints #1377

Noneangel opened this issue Feb 19, 2025 · 0 comments
Labels
enhancement New feature or request PR Contributors are encouranged to submit a pull request. Just ask in case you are interested.

Comments

@Noneangel
Copy link

Is your feature request related to a problem? Please describe.
I would like to chain negative code points using multi_text_key.

Describe the solution you'd like
In the wiki, it is stated that code support special negative values (listed in checkAndConvertCode).
Could it be possible to use those negative values in codePoints ?
Currently, this layout.json containing { "$": "multi_text_key", "codePoints": [-34, -11], "label": "U" } can not be imported: I have this error from the logs.

2025-02-19 23:51:43.740673 W CustomLayoutUtils: json layout parsed, but considered invalid
java.lang.IllegalArgumentException: Not a valid Unicode code point: 0xFFFFFFDE
	at java.lang.Character.toChars(Character.java:9241)
	at java.lang.StringFactory.newStringFromCodePoints(StringFactory.java:161)
	at helium314.keyboard.keyboard.internal.keyboard_parser.floris.KeyData$DefaultImpls.toKeyParams(TextKeyData.kt:402)
	at helium314.keyboard.keyboard.internal.keyboard_parser.floris.MultiTextKeyData.toKeyParams(TextKeyData.kt:659)
	at helium314.keyboard.keyboard.internal.keyboard_parser.floris.KeyData$DefaultImpls.toKeyParams$default(TextKeyData.kt:370)
	at helium314.keyboard.latin.utils.CustomLayoutUtilsKt.checkLayout(CustomLayoutUtils.kt:88)
	at helium314.keyboard.latin.utils.CustomLayoutUtilsKt.editCustomLayout$lambda$23(CustomLayoutUtils.kt:190)
	at helium314.keyboard.latin.utils.CustomLayoutUtilsKt.$r8$lambda$v_xZ-D_ypZMa5XCv9wLuyd7erqI(CustomLayoutUtils.kt:0)
	at helium314.keyboard.latin.utils.CustomLayoutUtilsKt$$ExternalSyntheticLambda0.onClick(R8$$SyntheticClass:0)
	at androidx.appcompat.app.AlertController$ButtonHandler.handleMessage(AlertController.java:167)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:201)
	at android.os.Looper.loop(Looper.java:288)
	at android.app.ActivityThread.main(ActivityThread.java:7918)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

Use case
I want to change case of the current word like described here #599 (comment). To do that, I want to select the word, then press shift with this key { "$": "multi_text_key", "codePoints": [-34, -11], "label": "U" }

@Noneangel Noneangel added the enhancement New feature or request label Feb 19, 2025
@Helium314 Helium314 added the PR Contributors are encouranged to submit a pull request. Just ask in case you are interested. label Feb 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request PR Contributors are encouranged to submit a pull request. Just ask in case you are interested.
Projects
None yet
Development

No branches or pull requests

2 participants