Closed XoR-42 closed 4 years ago
Please test on http://beta.etherpad.org
Please explain what keystokes are required on a UK keyboard for me to replicate this issue.
Hi, I tested on http://beta.etherpad.org and the issue remains. To my knowledge there are no dead keys on the standard UK layout. However you can reproduce the bug by switching to an international layout with dead keys such as "English (Macintosh)" or "English (UK, international with dead keys)" (these names are how they appear on Gnome) which allow you to type accents using dead keys. For example on the latter, Meta+[ followed by e should produce the character ë (Meta is usually mapped on right alt key). You can also try the french layout that has a dead key for ^ (the [ key on a standard qwerty keyboard): [ followed by e should produce the character ê.
Thanks for the work done on this wonderful piece of software. Best regards,
XoR
Works fine for me (English Macintosh) Alt Gr+ [ + e inserts ë
in FF 36 on https://beta.etherpad.org/p/31h77r9uyI
I just re-tested across several OSs and it seems to work with Firefox 36 on OSX (10.8.5) and with Firefox 34 on Windows (Server 2008). I'm only able to reproduce on Linux systems (Debian, Archlinux, Ubuntu) with different desktop environments (Gnome, Enlightenment, Unity).
I tested FF 36 on Ubuntu FYI -_- ;/
I just retried with Firefox 35 on Ubuntu + Unity, french keyboard and I was still unable to type a ê. It starts looking like a Heisenbug :/ EDIT: after updating to Firefox 36, I'm still able to reproduce...
What key do you have bound to Meta?
On my current machine (macbook pro running Gnome/Arch) with the "English (Macintosh)" layout, it's the right alt key. meta+e followed by e produces é, meta+` followed by a gives à etc. For the tests on the other machines I used the french layout and tried [ followed by e that is expected to produce ê (no meta key) or shift+[ followed by i that should produce ï.
By polling around, I found a Mint+Firefox 35+Gnome and a Gentoo+Firefox 31+xfce that do not exhibit the issue (french keyboard both of them)... We also tried with a clean Firefox profile without any addon on one of the affected machines and it didn't help, so I think we can rule out that explanation :/
I tried to reproduced in a controlled environment. I ran untouched Ubuntu live isos in kvm-qemu virtual machines, added the french layout and tried to type ê with the virtual keyboard (onboard) - to avoid any interference linked to hardware or emulation - into a pad on http://beta.etherpad.org.
With the 14.10 iso everything's fine, after updating firefox too. With the 15.04 daily build (http://cdimage.ubuntu.com/daily-live/current/) the bug appears and the dead keys to produce ê and ë characters do not work.
I hope that it will help to circumvent the bug, I'll try to find the time to dig into the code to understand its origin in the following weeks.
Best regards.
XoR
It sounds like the bug might be an OS bug if it's fine in 14.10 but not in 15.04.. I can try update my instances to 15.04 to see if I can create it..
I spotted a js warning in the console that seems related: KeyboardEvent.key values starting with "Dead" are obsolete and will be merged into just "Dead". For more help https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent.key I'm trying to find where the code responsible for the KeyboardEvent is.
jose@jose-healthy:~/etherpad-lite/src/static/js$ grep -rni dead .
jose@jose-healthy:~/etherpad-lite/src/static/js$ cd ..
jose@jose-healthy:~/etherpad-lite/src/static$ grep -rni dead .
jose@jose-healthy:~/etherpad-lite/src/static$
No our code?
ace2_inner.js handles key inputs btw.. And special keys..
Same problem here with firefox 37 on archlinux. My keyboard layout is altgr-intl, which uses dead keys quite a lot.
@tgirod Can you please provide exact steps to replicate? What key press combo are you using?
any accent followed by a letter will miss the accent. For example:
alt-
+ ewill give me
einstead of
è.
alt-^ + awill give me
ainstead of
â`
but alt-e
will give me é
as it should.
Installing Arch linux on a VM to test.
Alt-` does nothing for me.. Alt E brings up the Edit menu...
okay, my bad. As I said earlier, my keyboard layout variant is altgr-intl
. This turns the right alt key into AltGr. To see my problem, you have to set the XKbVariant (see my xorg.conf excerpt below) and use the right alt key.
Section "InputClass"
Identifier "system-keyboard"
MatchIsKeyboard "on"
Option "XkbLayout" "us"
Option "XkbOptions" "terminate:ctrl_alt_bksp"
Option "XkbVariant" "altgr-intl"
EndSection
I am suffering the same problem with a Spanish keyboard, which uses dead keys for accents (´,`,^,¨) If I type the dead key and then the character key at a normal pace, the accent is "lost" and I get "a" instead of "á".
However, if I do it quickly enough, the accent is preserved. It feels like if Etherpad does not have time to sync in between the pressing of the two keys, the input interprets the character code correctly.
My specs: Ubuntu 14.04 LTS, Firefox 37.0.1
Perhaps someone with a Spanish keyboard would be best to debug this. I'm simply unable to replicate the problem with my current setup.
Could you try this?
Let me know if I can try anything for debugging.
No need for alt gr?
Weirdly I can sometimes get â to show in the editor but it's not consistent..
Looks like it's something in handleKeyEvent
that is preventing the expected behaviour..
At least this is the way to replicate this behaviour consistently. I spent 25 mins on a fix to no avail. Alt Gr ' e works fine.. Alt Gr ' a does not work.. *boggles.
No alt-gr needed for Spanish keyboard accents. For me, the behaviour depends on your quickness. If you press both keys with a short enough period in between, it works. Try withoug AltGr, it's probably easier to be quick enough.
Well if I do '
then a
I get 'a
as a text string...
Did you switch your keyboard layout to Spanish?
yep.
Do you get a Ñ if you press ;
key?
No I get ;
afaik, that device upstairs now.
Then your kb layout is not changed, I'm afraid :-)
I tried changing each timed based event to increase by a factor of 10 and it did not make any difference which means it is something to do with a way we are handling keypresses assuming we are firing the wrong type of event on either keydown or keypress
This bug existed in old versions of Etherpad too so we might have to write some new logic handling.
Give this a go guys.. https://github.com/ether/etherpad-lite/tree/fix-dead-keys
Any dice anyone?
git checkout fix-dead-keys
to get the branch! :)
Hi, the patch seems to fix the issue for me when I'm using the french keyboard (to type ï and î for example), but the issue remains with the "english (macintosh)" keyboard and the combinations of keys including meta (meta+e e to get é, meta+` e to get è etc.)...
Well done for the partial fix at least!
I'd want to open a separate issue for Mac and keep that out of this one.
It's an improvement, but does not fix the problem at normal typing speed.
If you type ´
and then a
, you get the right á
.
However, if you type a
+´
+a
, you sometimes get aa
, instead of aá
.
The behaviour is inconsistent. Again, it seems like some kind of sync timing issue.
I don't think it's specific to mac, but rather general to the layouts using meta keys: I'm using this layout on a thinkpad which exhibits the same error.
@morallo yeah I can replicate that issue. I tried modifying all the timings that are set on key events and it doesn't effect the behaviour. Not sure what to suggest for that right now.
Dead keys seem to work fine for me now @XoR-42 . I tried your French example and got ê
which was expected.
It didn't change anything with my us altgr-intl
keyboard layout. Just in case I missed something, here is what I did:
git clone https://github.com/ether/etherpad-lite.git
cd etherpad-lite
git checkout fix-dead-keys
bin/run.sh
looks right @tgirod I will test your stuff later today if I can
@tgirod @JohnMcLear , that was what I was trying to explain, the fix seems to do the job for the "standard" dead keys, but doesn't seem to work for dead keys typed with a combination of meta+another key (like my "english (macintosh)" example or @tgirod 's "altgr-intl" example).
@JohnMcLear : "Dead keys seem to work fine for me now @XoR-42 . I tried your French example and got ê which was expected." That's what I was saying at 11pm yesterday, it works fine with the french keyboard (dead keys without modifiers) but not with the "english (macintosh)" layout (dead keys typed with combination involving meta, nothing to do with mac hardware).
I'm testing w/ Mac Kb doing AltGr + e
then e
which should give é and I can replicate the problem. The weird hting is jQuery is returning false for META key... I don't seem to get the metaKey boolean to trigger true on meta key values on any browsers.. I think I may be either on the wrong path or doing something wrong.. Can someone please test http://api.jquery.com/event.metakey/ and see if they can get it to return true?
I think maybe there has been some confusion between dead keys and meta keys in this thread..
Spent some more time on this today and didn't make much progress.. Will try later in the week..
I can still reproduce this problem on https://beta.etherpad.org/, but it is possible to input dead keys if you are quick. It's actually kind of usable for me, because I type quite fast, but it might be unusable for others and is certainly an usability nightmare.
I'm using the US International keyboard layout. ArchLinux, Firefox 38.0.
Steps to reproduce:
setxkbmap us intl
+1, same as @pyropeter
The use of dead keys to type accents does not seem to work in Firefox. For example typing 'ê' on a french keyboard, or any accent with the layout 'international with dead keys' leads to a character without accent.
It works properly in Chromium though.
Tested on the 'develop' branch locally, on pad.riseup.net and on pad.lqdn.fr. Browsers: Firefox Nightly 39 and Firefox 36 on Linux.