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

Add support for jp109 layout keys #284

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/classes/Keyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ class LedKeyboard {
numeric,
keys
};
enum class Key : uint16_t { // 127 items
enum class Key : uint16_t { // 132 items

logo = static_cast<uint8_t>(KeyAddressGroup::logo) << 8 | 0x01,
logo2,
Expand All @@ -151,7 +151,7 @@ class LedKeyboard {
arrow_right, arrow_left, arrow_bottom, arrow_top, num_lock, num_slash, num_asterisk,
num_minus, num_plus, num_enter,
num_1, num_2, num_3, num_4, num_5, num_6, num_7, num_8, num_9, num_0,
num_dot, intl_backslash, menu,
num_dot, intl_backslash, menu, jpbackslash, katakana, yen, henkan, muhenkan,

ctrl_left = static_cast<uint8_t>(KeyAddressGroup::keys) << 8 | 0xe0,
shift_left, alt_left, win_left,
Expand Down Expand Up @@ -248,7 +248,8 @@ class LedKeyboard {
Key::n1, Key::n2, Key::n3, Key::n4, Key::n5, Key::n6, Key::n7, Key::n8, Key::n9, Key::n0,
Key::enter, Key::backspace, Key::tab, Key::space, Key::minus, Key::equal,
Key::open_bracket, Key::close_bracket, Key::backslash, Key::dollar, Key::semicolon, Key::quote, Key::tilde,
Key::comma, Key::period, Key::slash, Key::caps_lock, Key::intl_backslash
Key::comma, Key::period, Key::slash, Key::caps_lock, Key::intl_backslash,
Key::jpbackslash, Key::katakana, Key::yen, Key::henkan, Key::muhenkan
};

bool m_isOpen = false;
Expand Down
5 changes: 5 additions & 0 deletions src/helpers/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,11 @@ namespace utils {
else if (val == "g7") key = LedKeyboard::Key::g7;
else if (val == "g8") key = LedKeyboard::Key::g8;
else if (val == "g9") key = LedKeyboard::Key::g9;
else if (val == "jpbackslash") key = LedKeyboard::Key::jpbackslash;
else if (val == "katakana") key = LedKeyboard::Key::katakana;
else if (val == "yen") key = LedKeyboard::Key::yen;
else if (val == "henkan") key = LedKeyboard::Key::henkan;
else if (val == "muhenkan") key = LedKeyboard::Key::muhenkan;
else return false;
return true;
}
Expand Down