Skip to content

Commit

Permalink
removing alt/control/etc keys from switch this messes up with the tun…
Browse files Browse the repository at this point in the history
…ics game
  • Loading branch information
capsterx committed Nov 5, 2020
1 parent 98a591a commit 53d5fa6
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/core/InputEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,9 @@ void InputEvent::set_key_repeat(bool repeat) {
* \return true if the SHIFT key is currently down
*/
bool InputEvent::is_shift_down() {
#ifdef __SWITCH__
return false;
#endif

SDL_Keymod mod = SDL_GetModState();
return mod & KMOD_SHIFT;
Expand All @@ -398,6 +401,9 @@ bool InputEvent::is_shift_down() {
* \return true if the CTRL key is currently down
*/
bool InputEvent::is_control_down() {
#ifdef __SWITCH__
return false;
#endif

SDL_Keymod mod = SDL_GetModState();
return mod & KMOD_CTRL;
Expand All @@ -411,6 +417,9 @@ bool InputEvent::is_control_down() {
* \return true if the ALT key is currently down
*/
bool InputEvent::is_alt_down() {
#ifdef __SWITCH__
return false;
#endif

SDL_Keymod mod = SDL_GetModState();
return mod & KMOD_ALT;
Expand All @@ -421,6 +430,9 @@ bool InputEvent::is_alt_down() {
* \return \c true if the caps lock key is currently active.
*/
bool InputEvent::is_caps_lock_on() {
#ifdef __SWITCH__
return false;
#endif

SDL_Keymod mod = SDL_GetModState();
return mod & KMOD_CAPS;
Expand All @@ -431,6 +443,9 @@ bool InputEvent::is_caps_lock_on() {
* \return \c true if the num lock key is currently active.
*/
bool InputEvent::is_num_lock_on() {
#ifdef __SWITCH__
return false;
#endif

SDL_Keymod mod = SDL_GetModState();
return mod & KMOD_NUM;
Expand Down Expand Up @@ -872,6 +887,9 @@ bool InputEvent::is_keyboard_non_direction_key_released() const {
* \return true if SHIFT was pressed during this keyboard event
*/
bool InputEvent::is_with_shift() const {
#ifdef __SWITCH__
return false;
#endif

return is_keyboard_event()
&& (internal_event.key.keysym.mod & KMOD_SHIFT);
Expand All @@ -886,6 +904,9 @@ bool InputEvent::is_with_shift() const {
* \return true if CTRL was pressed during this keyboard event
*/
bool InputEvent::is_with_control() const {
#ifdef __SWITCH__
return false;
#endif

return is_keyboard_event()
&& (internal_event.key.keysym.mod & KMOD_CTRL);
Expand All @@ -900,6 +921,9 @@ bool InputEvent::is_with_control() const {
* \return true if ALT was pressed during this keyboard event
*/
bool InputEvent::is_with_alt() const {
#ifdef __SWITCH__
return false;
#endif

return is_keyboard_event()
&& (internal_event.key.keysym.mod & KMOD_ALT);
Expand Down

0 comments on commit 53d5fa6

Please sign in to comment.