Skip to content

Commit

Permalink
input: fix screenshot button
Browse files Browse the repository at this point in the history
Resolves #1780
  • Loading branch information
rr- committed Nov 2, 2024
1 parent e0fc30e commit b84a9ff
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ INPUT_KEYBOARD_ASSIGN(INPUT_ROLE_EQUIP_UZIS, SDL_SCANCODE_4)
INPUT_KEYBOARD_ASSIGN(INPUT_ROLE_USE_SMALL_MEDI, SDL_SCANCODE_8)
INPUT_KEYBOARD_ASSIGN(INPUT_ROLE_USE_BIG_MEDI, SDL_SCANCODE_9)

INPUT_KEYBOARD_ASSIGN(INPUT_ROLE_SCREENSHOT, SDL_SCANCODE_PRINTSCREEN)
INPUT_KEYBOARD_ASSIGN(INPUT_ROLE_TOGGLE_FULLSCREEN, SDL_SCANCODE_UNKNOWN)
INPUT_KEYBOARD_ASSIGN(INPUT_ROLE_FPS, SDL_SCANCODE_F2)
INPUT_KEYBOARD_ASSIGN(INPUT_ROLE_BILINEAR, SDL_SCANCODE_F3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ INPUT_KEYBOARD_ASSIGN(INPUT_ROLE_USE_SMALL_MEDI, SDL_SCANCODE_8)
INPUT_KEYBOARD_ASSIGN(INPUT_ROLE_USE_BIG_MEDI, SDL_SCANCODE_9)
INPUT_KEYBOARD_ASSIGN(INPUT_ROLE_USE_FLARE, SDL_SCANCODE_COMMA)

INPUT_KEYBOARD_ASSIGN(INPUT_ROLE_SCREENSHOT, SDL_SCANCODE_PRINTSCREEN)
INPUT_KEYBOARD_ASSIGN(INPUT_ROLE_SWITCH_RESOLUTION, SDL_SCANCODE_F1)
INPUT_KEYBOARD_ASSIGN(INPUT_ROLE_SWITCH_INTERNAL_SCREEN_SIZE, SDL_SCANCODE_F2)
INPUT_KEYBOARD_ASSIGN(INPUT_ROLE_TOGGLE_BILINEAR_FILTER, SDL_SCANCODE_F3)
Expand Down
8 changes: 8 additions & 0 deletions src/tr1/specific/s_shell.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,14 @@ void S_Shell_SpinMessageLoop(void)
break;
}

case SDL_KEYUP:
// NOTE: needs special handling on Windows -
// SDL_SCANCODE_PRINTSCREEN is not sufficient to react to this.
if (event.key.keysym.sym == SDLK_PRINTSCREEN) {
Screenshot_Make(g_Config.screenshot_format);
}
break;

case SDL_TEXTEDITING:
UI_HandleTextEdit(event.text.text);
break;
Expand Down
8 changes: 8 additions & 0 deletions src/tr2/game/shell/common.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,14 @@ void Shell_ProcessEvents(void)
break;
}

case SDL_KEYUP:
// NOTE: needs special handling on Windows -
// SDL_SCANCODE_PRINTSCREEN is not sufficient to react to this.
if (event.key.keysym.sym == SDLK_PRINTSCREEN) {
Screenshot_Make(g_Config.rendering.screenshot_format);
}
break;

case SDL_TEXTEDITING:
UI_HandleTextEdit(event.text.text);
break;
Expand Down

0 comments on commit b84a9ff

Please sign in to comment.