Add Enter button to spec and keyboard_input

It was mistakenly left out.
This commit is contained in:
Vasily
2019-05-25 18:49:42 +02:00
committed by username223
parent eb25656eeb
commit 2d8f5a1b40
5 changed files with 12 additions and 0 deletions
@@ -68,6 +68,7 @@ A token is either a modifier symbol, literal symbol, symbol sequence or space ch
| Keypad Asterisk | `KPSTAR` |
| Keypad Minus | `KPMINUS` |
| Keypad Plus | `KPPLUS` |
| Enter | `ENTER` |
### Misc symbols
+6
View File
@@ -142,6 +142,10 @@ std::optional<Token> checkIfLegalCapitalLiteral( std::string input ) noexcept
{
return Token::KEY_KPPLUS;
}
if ( input == "ENTER" )
{
return Token::KEY_ENTER;
}
// LOG incorrect character
return std::nullopt;
@@ -382,6 +386,8 @@ bool isLiteral( const Token token ) noexcept
return true;
case Token::KEY_KPPLUS:
return true;
case Token::KEY_ENTER:
return true;
default:
return false;
+1
View File
@@ -76,6 +76,7 @@ enum class Token
KEY_KPSTAR,
KEY_KPMINUS,
KEY_KPPLUS,
KEY_ENTER,
// Misc tokens
TOKEN_NEW_SEQUENCE,
+2
View File
@@ -73,6 +73,8 @@ unsigned int tokenToKeyCode( const Token token, Display* const display )
return XK_KP_Subtract;
case Token::KEY_KPPLUS:
return XK_KP_Add;
case Token::KEY_ENTER:
return XK_Return;
case Token::MODIFIER_CTRL:
return XK_Control_L;
+2
View File
@@ -73,6 +73,8 @@ WORD convertToVirtualKeycode( const Token token )
return VK_SUBTRACT;
case Token::KEY_KPPLUS:
return VK_ADD;
case Token::KEY_ENTER:
return VK_RETURN;
case Token::MODIFIER_CTRL:
return VK_CONTROL;