Skip to content

Commit

Permalink
Add pause key support for VNC
Browse files Browse the repository at this point in the history
The pause key uses a complex mapping, for historical reasons. Move the
mapping currently used for this key from xorgxrdp into xrdp so that we
can use this key with VNC sessions.
  • Loading branch information
matt335672 committed Jun 14, 2024
1 parent 8ee4a6c commit 34dc47a
Show file tree
Hide file tree
Showing 30 changed files with 317 additions and 63 deletions.
6 changes: 4 additions & 2 deletions common/scancode.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ static const struct scancode_to_keycode
{ 0x165, 225 }, // VK_BROWSER_SEARCH I225 (KEY_SEARCH)
{ 0x166, 164 }, // VK_BROWSER_FAVORITES I164 (KEY_BOOKMARKS)
{ 0x16b, 165 }, // VK_LAUNCH_APP1 I165 (KEY_COMPUTER)
{ 0x16c, 163 } // VK_LAUNCH_MAIL I163 (KEY_MAIL)
{ 0x16c, 163 }, // VK_LAUNCH_MAIL I163 (KEY_MAIL)
{ 0x21d, 127 } // VK_PAUSE PAUS (KEY_PAUSE)
};

// Sources:-
Expand Down Expand Up @@ -291,7 +292,8 @@ static const struct scancode_to_keycode
{ 0x153, 107 }, // VK_DELETE DELE
{ 0x15b, 115 }, // VK_LWIN LWIN
{ 0x15c, 116 }, // VK_RWIN RWIN
{ 0x15d, 117 } // VK_APPS COMP
{ 0x15d, 117 }, // VK_APPS COMP
{ 0x21d, 110 } // VK_PAUSE PAUS
};

struct map_settings
Expand Down
5 changes: 4 additions & 1 deletion common/scancode.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,14 @@
#if !defined(SCANCODE_H)
#define SCANCODE_H

#define SCANCODE_PAUSE_KEY 0x21d /* E1 1D */

/**
* Looks up an RDP scancode
*
* @param scancode Scancode. Extended scancodes have bit 9 set
* (i.e. are in 0x100 - 0x1ff)
* (i.e. are in 0x100 - 0x1ff). The pause key
* is a special, outside this range.
* @return keycode, or 0 for no keycode
*/
unsigned short
Expand Down
6 changes: 5 additions & 1 deletion genkeymap/genkeymap.c
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,11 @@ output_file_section(FILE *outf,
unicode = wtext[0];
}

if (scancode > 0xff)
if (scancode > 0x1ff)
{
fputs("E1_", outf);
}
else if (scancode > 0x0ff)
{
fputs("E0_", outf);
}
Expand Down
8 changes: 8 additions & 0 deletions instfiles/km-00000406.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[shift]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -250,6 +251,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[altgr]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -372,6 +374,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[shiftaltgr]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -494,6 +497,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[capslock]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -616,6 +620,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[capslockaltgr]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -736,6 +741,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[shiftcapslock]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -858,6 +864,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[shiftcapslockaltgr]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -980,6 +987,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[numlock]
47="65463:U+0037" # KP_7
Expand Down
8 changes: 8 additions & 0 deletions instfiles/km-00000407.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[shift]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -250,6 +251,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[altgr]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -372,6 +374,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[shiftaltgr]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -494,6 +497,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[capslock]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -616,6 +620,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[capslockaltgr]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -737,6 +742,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[shiftcapslock]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -859,6 +865,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[shiftcapslockaltgr]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -981,6 +988,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[numlock]
47="65463:U+0037" # KP_7
Expand Down
8 changes: 8 additions & 0 deletions instfiles/km-00000409.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[shift]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -250,6 +251,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[altgr]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -372,6 +374,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[shiftaltgr]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -494,6 +497,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[capslock]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -616,6 +620,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[capslockaltgr]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -738,6 +743,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[shiftcapslock]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -860,6 +866,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[shiftcapslockaltgr]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -982,6 +989,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[numlock]
47="65463:U+0037" # KP_7
Expand Down
8 changes: 8 additions & 0 deletions instfiles/km-0000040a.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[shift]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -250,6 +251,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[altgr]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -372,6 +374,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[shiftaltgr]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -494,6 +497,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[capslock]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -616,6 +620,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[capslockaltgr]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -736,6 +741,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[shiftcapslock]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -858,6 +864,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[shiftcapslockaltgr]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -980,6 +987,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[numlock]
47="65463:U+0037" # KP_7
Expand Down
8 changes: 8 additions & 0 deletions instfiles/km-0000040b.toml
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[shift]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -250,6 +251,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[altgr]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -371,6 +373,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[shiftaltgr]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -490,6 +493,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[capslock]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -612,6 +616,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[capslockaltgr]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -732,6 +737,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[shiftcapslock]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -854,6 +860,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[shiftcapslockaltgr]
01="65307:U+001B" # Escape
Expand Down Expand Up @@ -973,6 +980,7 @@ E0_65="269025051" # XF86Search
E0_66="269025072" # XF86Favorites
E0_6B="269025075" # XF86MyComputer
E0_6C="269025049" # XF86Mail
E1_1D="65299" # Pause

[numlock]
47="65463:U+0037" # KP_7
Expand Down
Loading

0 comments on commit 34dc47a

Please sign in to comment.