Skip to content

Commit

Permalink
Take into an account SHIFT and CAPS LOCK being used at the same time (i…
Browse files Browse the repository at this point in the history
  • Loading branch information
ihhub authored and Kazhuu committed Jan 31, 2024
1 parent 238b4e4 commit 2d44aa7
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 2d44aa7

Please sign in to comment.