Skip to content

Commit

Permalink
Take into an account SHIFT and CAPS LOCK being used at the same time (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
ihhub authored Dec 24, 2023
1 parent 1b992e2 commit 48d0188
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/engine/localevent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,12 @@ namespace
return modifier;
}

char getCharacterFromPressedKey( const fheroes2::Key key, const int32_t mod )
char getCharacterFromPressedKey( const fheroes2::Key key, int32_t mod )
{
if ( ( mod & fheroes2::KeyModifier::KEY_MODIFIER_SHIFT ) && ( mod & fheroes2::KeyModifier::KEY_MODIFIER_CAPS ) ) {
mod = mod & ~( fheroes2::KeyModifier::KEY_MODIFIER_SHIFT | fheroes2::KeyModifier::KEY_MODIFIER_CAPS );
}

switch ( key ) {
case fheroes2::Key::KEY_1:
return ( fheroes2::KeyModifier::KEY_MODIFIER_SHIFT & mod ? '!' : '1' );
Expand Down

0 comments on commit 48d0188

Please sign in to comment.