Closed precondition closed 2 years ago
Well, to my understanding, dead keys are basically a compose sequence, just with a dedicated, character. Both involve the preprocessor on the input field waiting for all the keypresses before replacing/inputting the character into the field. The issue is that I'm not looking at the input field change, but the raw keypress events.
This will most likely be fixed when I move over to reacting to text field updates in order to fix dead keys.
Speaking of dead keys, I've also noticed that dead keys work if the ibus dæmon is not running but encounter the same problem as described in this issue if I have ibus running in the background.
Alright, recent update maaaybe fixed this issue. Could you test again?
It types "Process" when I activate unicode input mode with Ctrl+Shift+U and "Process" gets also typed on monkeytype on any of the keypresses consumed by Unicode Mode.
Shouldn't print Process anymore. Try again
It does not print Process anymore indeed. In fact, it does not print anything at all.
Yeah, i didnt know if that was going to fix it as I don't understand how this unicode input mode thing works.
Alright, recent update maaaybe fixed this issue. Could you test again?
I've got not context from what change happened there but I'm guessing it has to do with adding #wordsInput
to allow keys? The thing is IBus doesn't really generate any keypresses:
I discovered this by removing all styling properties from #wordsInput
and noticed characters inserted by IBus are shown on the text field, unlike normal normal keypresses which are ignored.
Relevant part of the code.
A way to fix this would be to use characters inserted in the text input instead of using direct keypresses (something like how typings.gg does it). This would be quite the big change though.
Or maybe even better: instead of using only characters from the text input, use keypresses like usual and if at some point a new character is found in the text box, remove it and use it as a keypress.
Looks like all states are inserted into the text field until pressing space/commiting the final character, where they're replaced with it. I'm not sure how to tackle this.
Edit: I just got a crazy idea that may solve this
Well, no luck. I tried:
oninput
event that compares the contents of #wordsInput
with its last contents. If it was smaller or the same, then it meant that IBus had inserted its final character. This doesn't work because the default keypress event still fires for the very last key (which commits the unicode), so the only way this could work would be completely undoing the last effects of handleAlpha()
and redo them with the new event.
Edit: Ok actually this does solve the original issue here, but doesn't fix using the keyboard dead key from the layout. (only ctrl+shift+u)handleAlpha()
, comparing them the same way as before. This doesn't work either because the keypress event fires before the input event. This means the contents of the textbox were read before they even change.I'm out of ideas for today. Maybe tomorrow I come up with something smarter.
Edit: Ok actually this does solve the original issue here, but doesn't fix using the keyboard dead key from the layout. (only ctrl+shift+u)
@SeerLite Personlly, I have no issues using dead keys from US INTL (AltGr version on Linux)
Oh, I'm using Latin American layout and the accent key (´) and other dead keys are managed by IBus, just like unicode codes. Is that not the case for you (do you not get the underline when you're about to insert them them)?
If not, maybe this fix can work for you! I'd still like to get it working with my layout though haha :s
Fun fact, I actually did solve this issue but only on Chrome. Firefox does something different that makes it send the final keypress. This also only happens on monkeytype... Hm
Oh, I'm using Latin American layout and the accent key (´) and other dead keys are managed by IBus, just like unicode codes. Is that not the case for you (do you not get the underline when you're about to insert them them)?
If not, maybe this fix can work for you! I'd still like to get it working with my layout though haha :s
I may have made a misuse of language when I mentioned GNU/Linux's ibus unicode input system in the description of the issue but I don't actually use the IBus dæmon. I only have it installed for the pinyin IME so it's almost always off. I couldn't find what's actually handling dead keys in my OS in my research. It may be something related to Gnome's GTK modules or something (although I use XFCE now). I definitely don't get an underline when I initiate a Ctrl+Shift+U unicode compose sequence like I do when I run the IBus dæmon.
Welp, this might or might not fix the issue for you then. Maybe whatever it is that handles the unicode code for you does exactly the same as IBus.
I disabled IBus and tested out the unicode sequence thing (on Firefox) and it doesn't work. It gets sent it directly to the textbox like with IBus, but without the first stage where it replaces the whole thing. (Sorry I'm explaining it terribly here haha.)
Also I just discovered without IBus dead keys don't work at all on Chromium for me like they do on Firefox.
Looks like this is gonna be too complicated to solve for all scenarios. The best way I can see is having different options in the settings for input handling, so users can test them out and use the one that works on their setup. But even just implementing that is gonna be a lot of work...
I'm gonna try to get the current "IBus ON" fix working and then I'll see if I can do anything else.
@precondition I made some changes to #753, I wonder if you could test them? You'd need to set up monkeytype locally and pull from my branch. Ask me if you need any help (though I think you know how to use git).
Currently it only works on Firefox (and it's gonna be a pain to get to work on Chrome), so if you test it do make sure it's on Firefox.
Alternatively try https://monkeytype-e5da5.web.app/
I have yet to set up monkeytype locally but this web app you linked to at least does not seem to like Ctrl+Shift+U unicode input either
If you open the inspector and remove all styling elements from #wordsInput
, the text box will be visible. Like this, do you get any characters inserted there when doing the ctrl + shift + u thing?
If you open the inspector and remove all styling elements from
#wordsInput
, the text box will be visible. Like this, do you get any characters inserted there when doing the ctrl + shift + u thing?
Very sorry for the late reply for I was busy studying for my exams; if I remove all styling, I don't see anything appear there when typing basic keys but I do see some characters appear when I use Ctrl+Shift+U+hex. The unicode characters "stack up" one after another until I press space to move to the next word.
Hello there, I have the same issue with Dead Keys. I noticed that in the https://monkeytype-e5da5.web.app/ version it is working. There any expectation if this https://monkeytype-e5da5.web.app/ will hit the production someday?
@eudennis Woah had forgotten about that one! If it's just about dead keys then check out #1325 if you haven't already, which likely fixes it :)
As for Ctrl+Shift+U unicode code input, I don't think I'll be trying to get that working at all in the end as there's just no way to differentiate the inserted "u" with a real "u".
The #1325 is not implemented yet... right? Or am I missing something?
The inupt rewrite is live now on the main site. Give it a quick test and let me know.
The input rewrite is live now on the main site. Give it a quick test and let me know.
It works for me now. Closing the issue.
PS: I also tested typing 'é' and 'è' in master mode and it behaves correctly too.
The website does not support symbols/letters entered via GNU/Linux's ibus unicode input system.
I am currently on XFCE Ubuntu and if I do something like Ctrl+Shift+U E9space to get the character "é", nothing prints, it's as if I am not doing anything.
Unicode input works in Firefox's fields so the problem isn't in the browser. In fact, unicode input works in most sites except typing tests site. Typeracer.com is the only typing site that I know which supports ibus unicode input.
Unlike issue #36, this does not involve dead keys. It's more of a compose sequence. However, this issue probably falls under the umbrella of #35 as it is an input method requiring multiple keystrokes for a single character.