Incorrect keys sent to Windows Server by tsclient

Bug #210094 reported by MountainX
4
Affects Status Importance Assigned to Milestone
gnome-control-center
Invalid
Undecided
Unassigned
tsclient
Invalid
Undecided
Unassigned
xkeyboard-config
Invalid
Undecided
Unassigned
rdesktop (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Binary package hint: rdesktop

In Ubuntu Hardy beta, when using System > Keyboard > Layouts > Options to do either:
1. swap capslock and ctrl keys or
2. make capslock an additional ctrl key
the expected ctrl key events are not sent to Windows machines over Terminals Services Client.

Right now I am using "RDP 5" and "make capslock an additional ctrl key" and none of the ctrl keys work. No matter what I do I cannot send a Ctrl-key combination to the Windows server via rdesktop.

I had minor problems in Gutsy with keyboard layout options but immediately upon upgrading to Hardy the problems became much worse.

FYI, I have applied the work around at this bug:
https://bugs.launchpad.net/ubuntu/+source/gnome-control-center/+bug/173350
xmodmap -e "clear lock" -e "add lock = Caps_Lock"

Should this bug be filed under the keyboard layout options package?

Revision history for this message
MountainX (dave-mountain) wrote :

This should correctly be listed as an issue with tsclient. I am changing the affected project now.

To reproduce (in Ubuntu Hardy beta using US english settings):
Go to System > Preferences > Keyboard
click Layouts tab and then click Layout Options button below
In the dialog window that opens, expand Ctrl key position
click "swap ctrl and CapsLock" (or probably any other non-default option)
test locally that the keys have been swapped
open tsclient and log on to Windows server
test the control key behavior. You should find that it is very screwed up. I have seen several different scenarios. My current one is that the old capslock (which is the ctrl key at the client now) is not the ctrl key nor the caps lock key at the server. The right ctrl key doesn't work on the server at all and the left ctrl key (which is correctly acting as the capslock on the client) is back to being a ctrl key on the remote server.

With other keyboard layout options (such as make capslock an addtitional ctrl key) I have found that none of the keys will send a ctrl signal to the server.

Revision history for this message
MountainX (dave-mountain) wrote :

Solved. See this thread:
http://ubuntuforums.org/showthread.php?t=738490

I finally found a solution by reading the man for xmodmap. Here is the info:

I'm using Hardy beta.

Do NOT use gnome's keyboard control (Ubuntu System > Preferences > Keyboard > Layout Options).
Instead follow the example in man xmodmap as explained below.

NOTE: before doing this, undo any changes in Keyboard layout options. Put the options back to defaults in gnome's keyboard control.

And, if you have done anything advanced to try to work around these issues, remove those modifications too. For example, the following is NOT needed so if you are using it, remove it (may require a restart):
xmodmap -e "clear lock" -e "add lock = Caps_Lock"

Put the following in a text file.

!
! Swap Caps_Lock and Control_L
!
remove Lock = Caps_Lock
remove Control = Control_L
keysym Control_L = Caps_Lock
keysym Caps_Lock = Control_L
add Lock = Caps_Lock
add Control = Control_L

save the above as /etc/SwapCapsCtrl.kmap

then, from a terminal, run:
xmodmap /etc/SwapCapsCtrl.kmap

To make the change permanent, do this:
edit /etc/rc.local
add the following before the last line that says 'exit 0'
sudo loadkeys /etc/SwapCapsCtrl.kmap

Now in tsclient (Terminal Services Client) version 0.150, in the Local Resources tab, make sure the correct keyboard layout is selected. For me, it is en-us. Previously I either left it blank (or I tried two letter codes like "us"). With the correct code, everything works. With the incorrect code, tsclient will often give an error when disconnecting -- and the keyboard layout options are not applied correctly, as mentioned previously.

Everything is now working exactly right for the first time.
__________________

Revision history for this message
MountainX (dave-mountain) wrote :

The line above that says "sudo loadkeys /etc/SwapCapsCtrl.kmap" should use xmodmap instead of loadkeys

Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. You reported this bug a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue for you. Can you try with the latest Ubuntu release? Do you still have to do the workaround? Thanks in advance.

Changed in rdesktop:
status: New → Incomplete
Revision history for this message
Martin Mai (mrkanister-deactivatedaccount-deactivatedaccount) wrote :

 We are closing this bug report because it lacks the information we need to investigate the problem, as described in the previous comments. Please reopen it if you can give us the missing information, and don't hesitate to submit bug reports in the future. To reopen the bug report you can click on the current status, under the Status column, and change the Status back to "New". Thanks again!

Changed in rdesktop:
status: Incomplete → Invalid
Changed in xkeyboard-config:
status: New → Invalid
Changed in tsclient:
status: New → Invalid
Changed in gnome-control-center:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.