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

xdotool writes the wrong case #121

Open
Caagr98 opened this issue May 29, 2016 · 6 comments

Comments

@Caagr98
Copy link

commented May 29, 2016

xdotool doesn't seem to set the right case on certain characters.

$ xdotool type áÁÅÄÀAĀȦĄ
ááåäàAĀȦĄ
$ xdotool type áÁÅÄÀAĀȦĄ (holding shift)
ÁÁÅÄAĀȦĄ

Also, if I compile it myself, I get the following error message:

$ ./xdotool type AaĀāȦȧĄąÁáÅåÄäÀà                  
AaX Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  100 (X_ChangeKeyboardMapping)
  Value in failed request:  0x0
  Serial number of failed request:  31
  Current serial number in output stream:  32
@mgruben

This comment has been minimized.

Copy link

commented Jun 18, 2016

Can confirm that I have this issue as well.

This issue may seem trivial, except it affects the functionality of things like KeePass, which for Linux uses xdotool for its auto-type functionality.

@mgruben

This comment has been minimized.

Copy link

commented Jun 18, 2016

From what I can tell, xdotool can accept keysym hexes as input for xdotool key [key].

This works for the vast majority of the keysyms recognized by Xmodmap, however exactly those keys mentioned in this issue fail via this method.

Example:
Á (Aaccute) corresponds to an Xmodmap keysym of 0x0c1.
xdotool key 0x0c1 incorrectly returns á
ninja edit
á (aaccute) corresponds to an Xmodmap keysym of 0x0e1.
xdotool key 0x0e1 correctly returns á

Could it be that xdotool is using a slightly different keymap than Xmodmap is passing to it?

@mgruben

This comment has been minimized.

Copy link

commented Jun 18, 2016

Also, it's worth mentioning that, contrary to its manpages, xdotool key Aaccute fails with

(symbol) No such key name 'Aaccute'. Ignoring it.
(symbol) No such key name 'Aaccute'. Ignoring it.

@mgruben

This comment has been minimized.

Copy link

commented Jun 18, 2016

Note that these keysym codes are also contained within /usr/include/X11/keysymdef.h.

in keysymdef.h:
Á (XK_Aaccute) corresponds to 0x00c1, and xdotool key 0x00c1 incorrectly returns á.
á (XK_aaccute) corresponds to 0x00e1, and xdotool key 0x00e1 correctly returns á.

@mgruben

This comment has been minimized.

Copy link

commented Jun 18, 2016

The following is the output of a bash script to test the outputs.

Note that every expected capital instead maps to its corresponding lowercase.

It might be that there's a blanket +0x020 shift, except the multiplication sign (0x00d7) does not map to the division sign (0x00f7)

for ((i=0x00c0;i< 0x00ff;i++));do echo ""; grep 00$i[4]$i[5] /usr/include/X11/keysymdef.h; xdotool key "0x00"$i[4]$i[5]; sleep 0.2; done

#define XK_Aacute                        0x00c1  /* U+00C1 LATIN CAPITAL LETTER A WITH ACUTE */
á
#define XK_Acircumflex                   0x00c2  /* U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX */
â
#define XK_Atilde                        0x00c3  /* U+00C3 LATIN CAPITAL LETTER A WITH TILDE */
ã
#define XK_Adiaeresis                    0x00c4  /* U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS */
ä
#define XK_Aring                         0x00c5  /* U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE */
å
#define XK_AE                            0x00c6  /* U+00C6 LATIN CAPITAL LETTER AE */
æ
#define XK_Ccedilla                      0x00c7  /* U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA */
ç
#define XK_Egrave                        0x00c8  /* U+00C8 LATIN CAPITAL LETTER E WITH GRAVE */
è
#define XK_Eacute                        0x00c9  /* U+00C9 LATIN CAPITAL LETTER E WITH ACUTE */
é
#define XK_Ecircumflex                   0x00ca  /* U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX */
ê
#define XK_Ediaeresis                    0x00cb  /* U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS */
ë
#define XK_Igrave                        0x00cc  /* U+00CC LATIN CAPITAL LETTER I WITH GRAVE */
ì
#define XK_Iacute                        0x00cd  /* U+00CD LATIN CAPITAL LETTER I WITH ACUTE */
í
#define XK_Icircumflex                   0x00ce  /* U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX */
î
#define XK_Idiaeresis                    0x00cf  /* U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS */
ï
#define XK_ETH                           0x00d0  /* U+00D0 LATIN CAPITAL LETTER ETH */
ð
#define XK_Ntilde                        0x00d1  /* U+00D1 LATIN CAPITAL LETTER N WITH TILDE */
ñ
#define XK_Ograve                        0x00d2  /* U+00D2 LATIN CAPITAL LETTER O WITH GRAVE */
ò
#define XK_Oacute                        0x00d3  /* U+00D3 LATIN CAPITAL LETTER O WITH ACUTE */
ó
#define XK_Ocircumflex                   0x00d4  /* U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX */
ô
#define XK_Otilde                        0x00d5  /* U+00D5 LATIN CAPITAL LETTER O WITH TILDE */
õ
#define XK_Odiaeresis                    0x00d6  /* U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS */
ö
#define XK_multiply                      0x00d7  /* U+00D7 MULTIPLICATION SIGN */
×
#define XK_Oslash                        0x00d8  /* U+00D8 LATIN CAPITAL LETTER O WITH STROKE */
#define XK_Ooblique                      0x00d8  /* U+00D8 LATIN CAPITAL LETTER O WITH STROKE */
ø
#define XK_Ugrave                        0x00d9  /* U+00D9 LATIN CAPITAL LETTER U WITH GRAVE */
ù
#define XK_Uacute                        0x00da  /* U+00DA LATIN CAPITAL LETTER U WITH ACUTE */
ú
#define XK_Ucircumflex                   0x00db  /* U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX */
û
#define XK_Udiaeresis                    0x00dc  /* U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS */
ü
#define XK_Yacute                        0x00dd  /* U+00DD LATIN CAPITAL LETTER Y WITH ACUTE */
ý
#define XK_THORN                         0x00de  /* U+00DE LATIN CAPITAL LETTER THORN */
þ
#define XK_ssharp                        0x00df  /* U+00DF LATIN SMALL LETTER SHARP S */
ß
#define XK_agrave                        0x00e0  /* U+00E0 LATIN SMALL LETTER A WITH GRAVE */
à
#define XK_aacute                        0x00e1  /* U+00E1 LATIN SMALL LETTER A WITH ACUTE */
á
#define XK_acircumflex                   0x00e2  /* U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX */
â
#define XK_atilde                        0x00e3  /* U+00E3 LATIN SMALL LETTER A WITH TILDE */
ã
#define XK_adiaeresis                    0x00e4  /* U+00E4 LATIN SMALL LETTER A WITH DIAERESIS */
ä
#define XK_aring                         0x00e5  /* U+00E5 LATIN SMALL LETTER A WITH RING ABOVE */
å
#define XK_ae                            0x00e6  /* U+00E6 LATIN SMALL LETTER AE */
æ
#define XK_ccedilla                      0x00e7  /* U+00E7 LATIN SMALL LETTER C WITH CEDILLA */
ç
#define XK_egrave                        0x00e8  /* U+00E8 LATIN SMALL LETTER E WITH GRAVE */
è
#define XK_eacute                        0x00e9  /* U+00E9 LATIN SMALL LETTER E WITH ACUTE */
é
#define XK_ecircumflex                   0x00ea  /* U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX */
ê
#define XK_ediaeresis                    0x00eb  /* U+00EB LATIN SMALL LETTER E WITH DIAERESIS */
ë
#define XK_igrave                        0x00ec  /* U+00EC LATIN SMALL LETTER I WITH GRAVE */
ì
#define XK_iacute                        0x00ed  /* U+00ED LATIN SMALL LETTER I WITH ACUTE */
í
#define XK_icircumflex                   0x00ee  /* U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX */
î
#define XK_idiaeresis                    0x00ef  /* U+00EF LATIN SMALL LETTER I WITH DIAERESIS */
ï
#define XK_eth                           0x00f0  /* U+00F0 LATIN SMALL LETTER ETH */
ð
#define XK_ntilde                        0x00f1  /* U+00F1 LATIN SMALL LETTER N WITH TILDE */
ñ
#define XK_ograve                        0x00f2  /* U+00F2 LATIN SMALL LETTER O WITH GRAVE */
ò
#define XK_oacute                        0x00f3  /* U+00F3 LATIN SMALL LETTER O WITH ACUTE */
ó
#define XK_ocircumflex                   0x00f4  /* U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX */
ô
#define XK_otilde                        0x00f5  /* U+00F5 LATIN SMALL LETTER O WITH TILDE */
õ
#define XK_odiaeresis                    0x00f6  /* U+00F6 LATIN SMALL LETTER O WITH DIAERESIS */
ö
#define XK_division                      0x00f7  /* U+00F7 DIVISION SIGN */
÷
#define XK_oslash                        0x00f8  /* U+00F8 LATIN SMALL LETTER O WITH STROKE */
#define XK_ooblique                      0x00f8  /* U+00F8 LATIN SMALL LETTER O WITH STROKE */
ø
#define XK_ugrave                        0x00f9  /* U+00F9 LATIN SMALL LETTER U WITH GRAVE */
ù
#define XK_uacute                        0x00fa  /* U+00FA LATIN SMALL LETTER U WITH ACUTE */
ú
#define XK_ucircumflex                   0x00fb  /* U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX */
û
#define XK_udiaeresis                    0x00fc  /* U+00FC LATIN SMALL LETTER U WITH DIAERESIS */
ü
#define XK_yacute                        0x00fd  /* U+00FD LATIN SMALL LETTER Y WITH ACUTE */
ý
#define XK_thorn                         0x00fe  /* U+00FE LATIN SMALL LETTER THORN */
þ
@jordansissel

This comment has been minimized.

Copy link
Owner

commented Jun 18, 2016

Thanks for helping trouble shoot all of this. I hope we can find a solution
for everyone - I know it's been an issue for a while :/

On Saturday, June 18, 2016, Michael Gruben notifications@github.com wrote:

The following is the output of a bash script to test the outputs.

Note that every expected capital instead maps to its corresponding
lowercase.

It might be that there's a blanket +0x020 shift, except the multiplication
sign (0x00d7) does not map to the division sign (0x00f7)

for ((i=0x00c0;i< 0x00ff;i++));do echo ""; grep 00$i[4]$i[5]
/usr/include/X11/keysymdef.h; xdotool key "0x00"$i[4]$i[5]; sleep 0.2; done

#define XK_Aacute 0x00c1 /* U+00C1 LATIN CAPITAL LETTER A WITH ACUTE /
á
#define XK_Acircumflex 0x00c2 /
U+00C2 LATIN CAPITAL LETTER A WITH CIRCUMFLEX /
â
#define XK_Atilde 0x00c3 /
U+00C3 LATIN CAPITAL LETTER A WITH TILDE /
ã
#define XK_Adiaeresis 0x00c4 /
U+00C4 LATIN CAPITAL LETTER A WITH DIAERESIS /
ä
#define XK_Aring 0x00c5 /
U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE /
å
#define XK_AE 0x00c6 /
U+00C6 LATIN CAPITAL LETTER AE /
æ
#define XK_Ccedilla 0x00c7 /
U+00C7 LATIN CAPITAL LETTER C WITH CEDILLA /
ç
#define XK_Egrave 0x00c8 /
U+00C8 LATIN CAPITAL LETTER E WITH GRAVE /
è
#define XK_Eacute 0x00c9 /
U+00C9 LATIN CAPITAL LETTER E WITH ACUTE /
é
#define XK_Ecircumflex 0x00ca /
U+00CA LATIN CAPITAL LETTER E WITH CIRCUMFLEX /
ê
#define XK_Ediaeresis 0x00cb /
U+00CB LATIN CAPITAL LETTER E WITH DIAERESIS /
ë
#define XK_Igrave 0x00cc /
U+00CC LATIN CAPITAL LETTER I WITH GRAVE /
ì
#define XK_Iacute 0x00cd /
U+00CD LATIN CAPITAL LETTER I WITH ACUTE /
í
#define XK_Icircumflex 0x00ce /
U+00CE LATIN CAPITAL LETTER I WITH CIRCUMFLEX /
î
#define XK_Idiaeresis 0x00cf /
U+00CF LATIN CAPITAL LETTER I WITH DIAERESIS /
ï
#define XK_ETH 0x00d0 /
U+00D0 LATIN CAPITAL LETTER ETH /
ð
#define XK_Ntilde 0x00d1 /
U+00D1 LATIN CAPITAL LETTER N WITH TILDE /
ñ
#define XK_Ograve 0x00d2 /
U+00D2 LATIN CAPITAL LETTER O WITH GRAVE /
ò
#define XK_Oacute 0x00d3 /
U+00D3 LATIN CAPITAL LETTER O WITH ACUTE /
ó
#define XK_Ocircumflex 0x00d4 /
U+00D4 LATIN CAPITAL LETTER O WITH CIRCUMFLEX /
ô
#define XK_Otilde 0x00d5 /
U+00D5 LATIN CAPITAL LETTER O WITH TILDE /
õ
#define XK_Odiaeresis 0x00d6 /
U+00D6 LATIN CAPITAL LETTER O WITH DIAERESIS /
ö
#define XK_multiply 0x00d7 /
U+00D7 MULTIPLICATION SIGN /
×
#define XK_Oslash 0x00d8 /
U+00D8 LATIN CAPITAL LETTER O WITH STROKE /
#define XK_Ooblique 0x00d8 /
U+00D8 LATIN CAPITAL LETTER O WITH STROKE /
ø
#define XK_Ugrave 0x00d9 /
U+00D9 LATIN CAPITAL LETTER U WITH GRAVE /
ù
#define XK_Uacute 0x00da /
U+00DA LATIN CAPITAL LETTER U WITH ACUTE /
ú
#define XK_Ucircumflex 0x00db /
U+00DB LATIN CAPITAL LETTER U WITH CIRCUMFLEX /
û
#define XK_Udiaeresis 0x00dc /
U+00DC LATIN CAPITAL LETTER U WITH DIAERESIS /
ü
#define XK_Yacute 0x00dd /
U+00DD LATIN CAPITAL LETTER Y WITH ACUTE /
ý
#define XK_THORN 0x00de /
U+00DE LATIN CAPITAL LETTER THORN /
þ
#define XK_ssharp 0x00df /
U+00DF LATIN SMALL LETTER SHARP S /
ß
#define XK_agrave 0x00e0 /
U+00E0 LATIN SMALL LETTER A WITH GRAVE /
à
#define XK_aacute 0x00e1 /
U+00E1 LATIN SMALL LETTER A WITH ACUTE /
á
#define XK_acircumflex 0x00e2 /
U+00E2 LATIN SMALL LETTER A WITH CIRCUMFLEX /
â
#define XK_atilde 0x00e3 /
U+00E3 LATIN SMALL LETTER A WITH TILDE /
ã
#define XK_adiaeresis 0x00e4 /
U+00E4 LATIN SMALL LETTER A WITH DIAERESIS /
ä
#define XK_aring 0x00e5 /
U+00E5 LATIN SMALL LETTER A WITH RING ABOVE /
å
#define XK_ae 0x00e6 /
U+00E6 LATIN SMALL LETTER AE /
æ
#define XK_ccedilla 0x00e7 /
U+00E7 LATIN SMALL LETTER C WITH CEDILLA /
ç
#define XK_egrave 0x00e8 /
U+00E8 LATIN SMALL LETTER E WITH GRAVE /
è
#define XK_eacute 0x00e9 /
U+00E9 LATIN SMALL LETTER E WITH ACUTE /
é
#define XK_ecircumflex 0x00ea /
U+00EA LATIN SMALL LETTER E WITH CIRCUMFLEX /
ê
#define XK_ediaeresis 0x00eb /
U+00EB LATIN SMALL LETTER E WITH DIAERESIS /
ë
#define XK_igrave 0x00ec /
U+00EC LATIN SMALL LETTER I WITH GRAVE /
ì
#define XK_iacute 0x00ed /
U+00ED LATIN SMALL LETTER I WITH ACUTE /
í
#define XK_icircumflex 0x00ee /
U+00EE LATIN SMALL LETTER I WITH CIRCUMFLEX /
î
#define XK_idiaeresis 0x00ef /
U+00EF LATIN SMALL LETTER I WITH DIAERESIS /
ï
#define XK_eth 0x00f0 /
U+00F0 LATIN SMALL LETTER ETH /
ð
#define XK_ntilde 0x00f1 /
U+00F1 LATIN SMALL LETTER N WITH TILDE /
ñ
#define XK_ograve 0x00f2 /
U+00F2 LATIN SMALL LETTER O WITH GRAVE /
ò
#define XK_oacute 0x00f3 /
U+00F3 LATIN SMALL LETTER O WITH ACUTE /
ó
#define XK_ocircumflex 0x00f4 /
U+00F4 LATIN SMALL LETTER O WITH CIRCUMFLEX /
ô
#define XK_otilde 0x00f5 /
U+00F5 LATIN SMALL LETTER O WITH TILDE /
õ
#define XK_odiaeresis 0x00f6 /
U+00F6 LATIN SMALL LETTER O WITH DIAERESIS /
ö
#define XK_division 0x00f7 /
U+00F7 DIVISION SIGN /
÷
#define XK_oslash 0x00f8 /
U+00F8 LATIN SMALL LETTER O WITH STROKE /
#define XK_ooblique 0x00f8 /
U+00F8 LATIN SMALL LETTER O WITH STROKE /
ø
#define XK_ugrave 0x00f9 /
U+00F9 LATIN SMALL LETTER U WITH GRAVE /
ù
#define XK_uacute 0x00fa /
U+00FA LATIN SMALL LETTER U WITH ACUTE /
ú
#define XK_ucircumflex 0x00fb /
U+00FB LATIN SMALL LETTER U WITH CIRCUMFLEX /
û
#define XK_udiaeresis 0x00fc /
U+00FC LATIN SMALL LETTER U WITH DIAERESIS /
ü
#define XK_yacute 0x00fd /
U+00FD LATIN SMALL LETTER Y WITH ACUTE /
ý
#define XK_thorn 0x00fe /
U+00FE LATIN SMALL LETTER THORN */
þ


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#121 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAIC6smmwDSSbVSXSNa72JUufPPwsMkLks5qNAfkgaJpZM4IpWfp
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.