Skip to content

Commit

Permalink
Add missing Sun keyboard keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix Schmidt committed Jul 8, 2020
1 parent 2393393 commit 7a49ea6
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 5 deletions.
6 changes: 6 additions & 0 deletions src/lib/barrier/key_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,12 @@ const KeyNameMapEntry kKeyNameMap[] = {
{ "WWWSearch", kKeyWWWSearch },
{ "WWWStop", kKeyWWWStop },
{ "Zenkaku", kKeyZenkaku },
{ "Copy", kKeyCopy },
{ "Cut", kKeyCut },
{ "Open", kKeyOpen },
{ "Paste", kKeyPaste },
{ "Props", kKeyProps },
{ "Front", kKeyFront },
{ "Space", 0x0020 },
{ "Exclaim", 0x0021 },
{ "DoubleQuote", 0x0022 },
Expand Down
7 changes: 7 additions & 0 deletions src/lib/barrier/key_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,13 @@ static const KeyID kKeySuper_R = 0xEFEC; /* Right super */
static const KeyID kKeyHyper_L = 0xEFED; /* Left hyper */
static const KeyID kKeyHyper_R = 0xEFEE; /* Right hyper */

static const KeyID kKeyCopy = 0xEFEF;
static const KeyID kKeyCut = 0xEFF0;
static const KeyID kKeyOpen = 0xEFF1;
static const KeyID kKeyPaste = 0xEFF2;
static const KeyID kKeyProps = 0xEFF3;
static const KeyID kKeyFront = 0xEFF4;

// multi-key character composition
static const KeyID kKeyCompose = 0xEF20;
static const KeyID kKeyDeadGrave = 0x0300;
Expand Down
13 changes: 8 additions & 5 deletions src/lib/platform/XWindowsUtil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1261,11 +1261,11 @@ static const KeySym s_map1008FF[] =
/* 0x38 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 0x40 */ kKeyAppUser1, kKeyAppUser2, 0, 0, 0, 0, 0, 0,
/* 0x48 */ 0, 0, kKeyMissionControl, kKeyLaunchpad, 0, 0, 0, 0,
/* 0x50 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 0x58 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 0x50 */ 0, 0, 0, 0, 0, 0, 0, kKeyCopy,
/* 0x58 */ kKeyCut, 0, 0, 0, 0, 0, 0, 0,
/* 0x60 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 0x68 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 0x70 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 0x68 */ 0, 0, 0, kKeyOpen, 0, kKeyPaste, 0, 0,
/* 0x70 */ kKeyProps, kKeyFront, 0, 0, 0, 0, 0, 0,
/* 0x78 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 0x80 */ 0, 0, 0, 0, 0, 0, 0, 0,
/* 0x88 */ 0, 0, 0, 0, 0, 0, 0, 0,
Expand All @@ -1285,7 +1285,6 @@ static const KeySym s_map1008FF[] =
/* 0xf8 */ 0, 0, 0, 0, 0, 0, 0, 0
};


//
// XWindowsUtil
//
Expand Down Expand Up @@ -1546,6 +1545,10 @@ XWindowsUtil::mapKeySymToKeyID(KeySym k)
// "Internet" keys
return s_map1008FF[k & 0xff];

case 0x1009ff00:
// "Sun" keys
return s_map1008FF[k & 0xff];

default: {
// lookup character in table
KeySymMap::const_iterator index = s_keySymToUCS4.find(k);
Expand Down

0 comments on commit 7a49ea6

Please sign in to comment.