-
-
Notifications
You must be signed in to change notification settings - Fork 40.2k
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
Add Turkish keymap aliases and sendstring LUT #7676
Conversation
Hey there, awesome! Thanks @fauxpark I'll test the keys for
and checking the output suffice? Or are there proper methods which I'm not yet aware of ? Thanks again for the awesome job! |
🤘 |
@Ardakilic That would be the best way to test that out, yeah. |
Unfortunately the sendstring LUT, by its nature, only addresses ASCII characters. If you need to type Ğ you have to use And of course, this will only work if you have the Turkish input layout set in your OS. |
Also pinging @bbaserdem here. Although I don't know him personally, he's the first person I stumbled upon while checking Turkish layout for ortholinear keyboards. |
Thanks for pinging me, this is nice feature to add. I would also translate to turkish F layout (Instead of the TR_ prefix, maybe use TQ for turkish q prefix? Then we can include a TF prefix for turkish f?) From what I understand, the sendkeys function only sends keycodes, not unicode sequences. (which would also increase string type time by 5 which is undesirable.) So as @fauxpark stated, the only way to accomplish would be to detect non-ascii characters in string and send them with their specific modifiers. Sendkeys already does this with capital letters and shift, so it should not be too difficult to do. (I would do it cause I am working on my own keymap right now.) For the record, my implementation was; I wrote some custom keycodes that detected if shift was pressed, and sent the correct case of the turkish letter unicode sequences. But I abandoned that implementation since the unicode is dependent on the us qwerty layout. Correct me if I am wrong. Currently the only thing I do for turkish layout is include some other keys in my planck layout so if i switch to F on software keymap, I have access to all letters. (But planck is too small for all the turkish letters so I seldom do this) |
@fauxpark @drashna All I have to do is compile like I do, and these will be included into the compiled firmware, right? Do I have to add anything else to my keyboard files ? @bbaserdem These keycodes and maps are useful only when you've set Turkish as your OS's language. Aside from that, I do similar approach (E.g: In my handwired 40%, for |
@Ardakilic you also have to @bbaserdem I don't think it will be that easy to get Unicode sendstring working, due to the sheer number of characters that then must be mapped - probably it will not fit on a 32U4. But if you have an idea, do share it :) |
@fauxpark, unicode sendstring method does not work with non-us layouts, at least not on linux. My usecase is I use xkbmap on linux to set my keyboard layout to us-dvorak, and switch between turkish-f and us-q, and have ibus for unicode and emoji. Since my default layout is dvorak, the unicode methods' send string is converted to different letters by libinput, and the hex code is garbled. I have not found any way to ignore xkb keymap in ibus input so I have abandoned using unicode keys. I find that besides these edge cases, I don't find any use in it. The only non-ascii letters in a turkish string should be I just checked and TF is not associated with any other language abbreviation. TF_* keycodes can be used to also do a turkish f keyboard database. I do not know how to add suggestions to your pull request, but I can submit it along with my upcoming update to my userspace code. |
The issue here is that Unicode characters are multiple bytes, and the sendstring LUTs operate only on single bytes. Here's an example The Additionally, my earlier statement that the LUT could be extended was wrong. |
Checking these strings;
All the first bytes in UTF are C3 or C4. They could be treated as edge cases; since they do not correspond to keycodes as far as I see? Correct me if I am wrong but the send_string_with_delay_p function reads multiple characters for the edge cases. And the send-off does not need to be unicode strings, it can just be keypresses with modifiers activated. (Obviously the implementation would be dependent on the F or Q layouts being used.) I can take a stab at trying it out this weekend. (I think if this request follows through, I can bring my master branch up to date with upstream, and then edit the existing code. I don't think I can submit an amendment to this request since I am not a maintainer, I'm still trying to get the hang of using git and github.) People would have to specifically work with UTF-8 on their respective code editors, but that should not be a problem. (My programming skills with C is pretty low; if I am saying something really stupid I thank you for your patience.) |
I say it's good to merge. Turkish characters such as Ğ ğ etc. on macros don't work, but for the time being, as mentioned, tap_code is a workaround and works. |
Added the Turkish F keymap and sendstring LUT. @bbaserdem I did some Googling and it appears to be fairly trivial to extract codepoints from a stream of UTF-8 bytes, so there is possibly a pathway there to have a sendstring-like function that works with UTF-8 string literals (cf. |
Yes, I agree that it is out of scope with the sendstring functions we have currently. I don't know if there is any merit to code for it; as I certainly would not use it. I looked at your keymaps, and it is different than my f layout that I was planning on submitting after your fork got pulled in.. I found no dead-keys on the alt-gr, and some symbols have different locations. All the dead keys are on altgr + shift. I am using the Xorg implementation (on arch linux, and using setxkbmap)
|
Awesome, thanks again for all the reviews and the merge 🎉 |
* upstream/master: (330 commits) Add Danish keymap and sendstring LUT (qmk#8218) format code according to conventions [skip ci] uart.c fix from TMK (qmk#7628) S75 Encoder Fixes (qmk#7758) Add Turkish keymap aliases and sendstring LUT (qmk#7676) Add Arm Teensys to mcu_selection.mk (qmk#8026) [New keyboard]silverbullet44 (qmk#7950) Allow 30us matrix delay to be keyboard/user overridable (qmk#8216) Merge /prime_l and /prime_l_v2 (qmk#8194) [Keymap] Keymap for XD75 with 7U spacebar EN-RU gamers (qmk#8184) Add VIA support for kbd8x mk2 (qmk#8168) Move Grave/Tilde and some lesser used keys on my ergo boards (qmk#8200) [Keyboard] KC60SE cleanup (qmk#8171) Made windows driver installation accept y as All to allow CI (qmk#8189) Change the image photo of /keyboards/reviung41/readme.md (qmk#8195) MxSS RGB Handler Touchup (qmk#8105) Centromere Configurator layout support and readme update (qmk#8190) dynamic keymap sanity check (qmk#8181) [keyboard] Austin (qmk#8176) Use pathlib everywhere we can (qmk#7872) ...
* Add Turkish keymap aliases and sendstring LUT * Split into F and Q layouts
* 'master' of https://github.com/nesth/qmk_firmware: (331 commits) helix like crkbd Add Danish keymap and sendstring LUT (qmk#8218) format code according to conventions [skip ci] uart.c fix from TMK (qmk#7628) S75 Encoder Fixes (qmk#7758) Add Turkish keymap aliases and sendstring LUT (qmk#7676) Add Arm Teensys to mcu_selection.mk (qmk#8026) [New keyboard]silverbullet44 (qmk#7950) Allow 30us matrix delay to be keyboard/user overridable (qmk#8216) Merge /prime_l and /prime_l_v2 (qmk#8194) [Keymap] Keymap for XD75 with 7U spacebar EN-RU gamers (qmk#8184) Add VIA support for kbd8x mk2 (qmk#8168) Move Grave/Tilde and some lesser used keys on my ergo boards (qmk#8200) [Keyboard] KC60SE cleanup (qmk#8171) Made windows driver installation accept y as All to allow CI (qmk#8189) Change the image photo of /keyboards/reviung41/readme.md (qmk#8195) MxSS RGB Handler Touchup (qmk#8105) Centromere Configurator layout support and readme update (qmk#8190) dynamic keymap sanity check (qmk#8181) [keyboard] Austin (qmk#8176) ...
* Add Turkish keymap aliases and sendstring LUT * Split into F and Q layouts
* Add Turkish keymap aliases and sendstring LUT * Split into F and Q layouts
* Add Turkish keymap aliases and sendstring LUT * Split into F and Q layouts
* Add Turkish keymap aliases and sendstring LUT * Split into F and Q layouts
* Add Turkish keymap aliases and sendstring LUT * Split into F and Q layouts
* Add Turkish keymap aliases and sendstring LUT * Split into F and Q layouts
* Add Turkish keymap aliases and sendstring LUT * Split into F and Q layouts
Description
@Ardakilic here you go, please test this :)
Types of Changes
Issues Fixed or Closed by This PR
Checklist