Skip to content

Commit

Permalink
Input|libgui: Handle the non-US backslash/tilde/accent key
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Sep 1, 2019
1 parent 579d2ec commit d13c484
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions doomsday/apps/client/src/ui/b_util.cpp
Expand Up @@ -903,6 +903,7 @@ static keyname_t const keyNames[] = {
{ DDKEY_MULTIPLY, "multiply" },
{ DDKEY_SECTION, "section" },
{ DDKEY_WINMENU, "winmenu" },
{ DDKEY_ISOEXTRAKEY, "extra" },
{ 0, nullptr}
};

Expand Down
1 change: 1 addition & 0 deletions doomsday/libs/gui/include/de/input/ddkey.h
Expand Up @@ -90,6 +90,7 @@ enum {
DDKEY_MULTIPLY, ///< '*' on the numeric keypad.
DDKEY_SECTION, ///< §
DDKEY_WINMENU, ///< Windows-specific context menu key.
DDKEY_ISOEXTRAKEY, ///< Non-US: backslash, or tilde/accent, or </> (depending on country).
DD_HIGHEST_KEYCODE
};

Expand Down
5 changes: 5 additions & 0 deletions doomsday/libs/gui/src/input/keyevent.cpp
Expand Up @@ -221,6 +221,11 @@ int KeyEvent::ddKeyFromSDL(int sdlKey, int scancode)
return sdlKey;
}

if (scancode == SDL_SCANCODE_NONUSBACKSLASH)
{
return DDKEY_ISOEXTRAKEY;
}

// Non-character-inserting keys.
switch (sdlKey)
{
Expand Down

0 comments on commit d13c484

Please sign in to comment.