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

AltGr with swedish layout causes keyboard to get wedged #824

Closed
totaam opened this issue Mar 18, 2015 · 22 comments
Closed

AltGr with swedish layout causes keyboard to get wedged #824

totaam opened this issue Mar 18, 2015 · 22 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Mar 18, 2015

Issue migrated from trac ticket # 824

component: server | priority: major | resolution: fixed | keywords: keyboard AltGr

2015-03-18 15:59:59: mnbvc created the issue


Xpra version 0.15 on both server and client.

To reproduce:

  • Start server with
xpra start :178 --input-method=uim --no-speaker --no-microphone --no-clipboard --start-child=xterm --start-child=chromium-browser -d keyboard
  • Start client as
C:\Program Files (x86)\Xpra>start Xpra attach ssh:meingbg@x.uxu.se:178 -d keyboard
  • Enter the string ÅÄÖåäö[]|ÅÄÖåäö[]| repeatedly, alternating between xterm and chromium-browser.
    [[BR]]
    Expected:
    The visible entered text in both applications will be ÅÄÖåäö[]|ÅÄÖåäö[]| after each time it is entered.
    [[BR]]
    Actual:
    The first few times, the visible entered text in will be ÅÄÖåäö[]|ÅÄÖåäö[]| in both applications.
    However, after a few repetitions, the visible text in chromium will be ||, and in xterm ÅÄÖåäöÛÝü.
@totaam
Copy link
Collaborator Author

totaam commented Mar 19, 2015

2015-03-19 07:25:52: mnbvc uploaded file kbd-bug.zip (379.1 KiB)

@totaam
Copy link
Collaborator Author

totaam commented Mar 19, 2015

2015-03-19 07:29:51: mnbvc commented


Btw, logs form both ends are included, with -d keyboard.

@totaam
Copy link
Collaborator Author

totaam commented Sep 17, 2015

2015-09-17 17:02:59: antoine changed status from new to assigned

@totaam
Copy link
Collaborator Author

totaam commented Sep 17, 2015

2015-09-17 17:02:59: antoine commented


(setting milestone)

@totaam
Copy link
Collaborator Author

totaam commented Oct 30, 2015

2015-10-30 12:04:27: antoine changed status from assigned to new

@totaam
Copy link
Collaborator Author

totaam commented Oct 30, 2015

2015-10-30 12:04:27: antoine changed owner from antoine to mnbvc

@totaam
Copy link
Collaborator Author

totaam commented Oct 30, 2015

2015-10-30 12:04:27: antoine commented


Important data I found in the bug report zip file:

  • client OS: Windows Vista?
  • server OS: Ubuntu 14.04
  • keyboard layout: se

@mnbvc: is this correct? how do I set my windows keyboard to 'se'? How do I press those keys? (preferably specifying their exact location on a standard pc105 keyboard since I'm not going to have a 'se' keyboard at hand)

Can you please also try the latest beta (client and/or server) to see if it helps in any way?

Does it look like this one? [http://johanegustafsson.net/projects/swerty/images/swerty.svg]

@totaam
Copy link
Collaborator Author

totaam commented Oct 30, 2015

2015-10-30 14:49:41: mnbvc changed owner from mnbvc to antoine

@totaam
Copy link
Collaborator Author

totaam commented Oct 30, 2015

2015-10-30 14:49:41: mnbvc commented


Replying to [comment:3 antoine]:

Important data I found in the bug report zip file:

  • client OS: Windows Vista?
  • server OS: Ubuntu 14.04
  • keyboard layout: se

@mnbvc: is this correct?
[[BR]]
Yes.


how do I set my windows keyboard to 'se'?
[[BR]]
How to set your windows keyboard to 'se' on windows vista: Open control panel, search for "language", under heading "national settings and..." select "switch keyboard or other input devices". Go to tab "keyboards and language", click "switch keyboard". On tab "general", click "add". In the list, select "swedish (sweden)", "keyboard layout", "swedish". Click OK. Now, back on tab "general", there should be a selection box for "standard input language". Select "Swedish (Sweden) - Swedish". Click ok. Click ok.


How do I press those keys? (preferably specifying their exact location on a standard pc105 keyboard since I'm not going to have a 'se' keyboard at hand)
[[BR]]
My guess is that the right Alt key on your keyboard is what becomes the "Alt Gr" key. You can confirm this by opening notepad and press for example AltGr+7 to produce a "{". This will also confirm that swedish layout is active for newly created windows, which is what you'll need to reproduce the bug.

To write "ÅÄÖåäö" using US hardware and swedish software settings, press Shift+[ Shift+' Shift+; [ ' ;. Without swedish settings, this is what normally would produce the six-character string {":['; using a US keyboard. To write "[]" with swedish software settings, press AltGr+8 AltGr+9. I'm not sure how to write "|" on a US keyboard with swedish settings, but you could try AltGr+| or AltGr+` (the key to the left of 1), if it turns out not to be possible I hope the other characters are enough for debugging.


Can you please also try the latest beta (client and/or server) to see if it helps in any way?
[[BR]]
Will do asap. Will update with results.


Does it look like this one?
[[BR]]
No. The keyboard looks like this:
[[Image(https://upload.wikimedia.org/wikipedia/commons/e/e0/KB_Sweden.svg)]]

@totaam
Copy link
Collaborator Author

totaam commented Nov 16, 2015

2015-11-16 10:59:47: antoine changed owner from antoine to mnbvc

@totaam
Copy link
Collaborator Author

totaam commented Nov 16, 2015

2015-11-16 10:59:47: antoine commented


For my own reference, here's a US layout:
[[Image(http://i.stack.imgur.com/0NFki.png)]]

As per #817, I can now also test by changing the keyboard layout at runtime.

||# Keys [[BR]](on UK Layout)||# US Layout||# UK Layout||# Swedish Layout||
||Shift + [||{||{||Å||
||Shift + '||"||@||Ä||
||Shift + ;||:||:||Ö||
||[||[||[||å||
||'||'||'||ä||
||;||;||;||ö||
||8||8||8||[||
||9||9||9||]||
||AltGr + \||(unknown)||(nothing)|| | ||

Doing the same in an xpra session gives the same result.

Here's a simplified -d keyboard log for those 6 key presses (grepped for "pressing"):

handle keycode pressing 50: key Shift_L
handle keycode pressing 34: key Aring
handle keycode unpressing 34: key Aring
handle keycode pressing 48: key Adiaeresis
handle keycode unpressing 48: key Adiaeresis
handle keycode pressing 47: key Odiaeresis
handle keycode unpressing 47: key Odiaeresis
handle keycode unpressing 50: key Shift_L
handle keycode pressing 34: key aring
handle keycode unpressing 34: key aring
handle keycode pressing 48: key adiaeresis
handle keycode unpressing 48: key adiaeresis
handle keycode pressing 47: key odiaeresis
handle keycode unpressing 47: key odiaeresis

@mnbvc: I couldn't make it misbehave, what do I need to do to break it?
If you can reproduce it, the -d keyboard log should be showing some sort of event when that happens.

@totaam
Copy link
Collaborator Author

totaam commented Nov 16, 2015

2015-11-16 11:06:52: antoine changed status from new to assigned

@totaam
Copy link
Collaborator Author

totaam commented Nov 16, 2015

2015-11-16 11:06:52: antoine changed owner from mnbvc to antoine

@totaam
Copy link
Collaborator Author

totaam commented Nov 16, 2015

2015-11-16 11:06:52: antoine changed title from AltGr to AltGr with swedish layout causes keyboard to get wedged

@totaam
Copy link
Collaborator Author

totaam commented Nov 16, 2015

2015-11-16 11:06:52: antoine commented


(managed to reproduce it)

@totaam
Copy link
Collaborator Author

totaam commented Nov 16, 2015

2015-11-16 12:35:06: antoine commented


The problem comes from this sequence of keypresses when we press AltGr:

handle keycode pressing 138: key Alt_R
make_keymask_match(('mod5',)) current mask: set(['mod1']), wanted: set(['mod5']), ignoring=94/['bar'], keys_pressed={138: 'Alt_R'}
found the key pressed for mod1: Alt_R
make_keymask_match(remove) ('mod5',) modifier mod1 using 138, success: True
keynames(mod5)=set(['ISO_Level3_Shift', 'Mode_switch']), keycodes=[113, 124, 8], nuisance=False
make_keymask_match(add) ('mod5',) modifier mod5 using 113, success: True

So we press Alt_R then unpress it, then press "mod5"...

That's because of this nasty piece of code I wrote a long long time ago to workaround AltGr on 'fr' layouts: [/browser/xpra/trunk/src/xpra/platform/win32/keyboard.py xpra/platform/win32/keyboard.py]..

So r11246 makes it possible to disable this code completely by setting this environment variable before running the win32 client:

set XPRA_EMULATE_ALTGR=0
Xpra_cmd.exe attach ...

With this in place, I am unable to reproduce this particular bug... but I am also unable to type |...

@mnbvc: there is a windows beta build available with this change, is this an improvement for you?

I could backport part of this to v0.14.x, and maybe even consider making this the default if I can find a better workaround for the 'fr' layout and missing |.

Could also be related to #62, #602, #923, #759, #108

@totaam
Copy link
Collaborator Author

totaam commented Nov 16, 2015

2015-11-16 16:11:43: antoine changed status from assigned to new

@totaam
Copy link
Collaborator Author

totaam commented Nov 16, 2015

2015-11-16 16:11:43: antoine changed owner from antoine to mnbvc

@totaam
Copy link
Collaborator Author

totaam commented Nov 16, 2015

2015-11-16 16:11:43: antoine commented


I believe that r11247 fixes this bug (see #923). I can type all the characters including | and the keyboard no longer gets wedged in a bad state.

This is a server side fix, I will be making new test builds shortly.

@mnbvc: please let me know if that fixes things for you.

@totaam
Copy link
Collaborator Author

totaam commented Dec 5, 2015

2015-12-05 10:52:24: antoine changed status from new to closed

@totaam
Copy link
Collaborator Author

totaam commented Dec 5, 2015

2015-12-05 10:52:24: antoine set resolution to fixed

@totaam
Copy link
Collaborator Author

totaam commented Dec 5, 2015

2015-12-05 10:52:24: antoine commented


Not heard back, closing. Feel free to re-open if this is still a problem.

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

No branches or pull requests

1 participant