From: Holger Schemel Date: Thu, 16 Jun 2016 22:21:50 +0000 (+0200) Subject: added recognizing keypad keys +/-/0 as window scaling key shortcuts X-Git-Tag: 4.0.0.0-rc3~2 X-Git-Url: https://git.artsoft.org/?a=commitdiff_plain;h=ad9e949d57e4055331f1eb0a14a9b8b6ebe6a7c3;p=rocksndiamonds.git added recognizing keypad keys +/-/0 as window scaling key shortcuts --- diff --git a/src/events.c b/src/events.c index d749ad3d..2d1e0659 100644 --- a/src/events.c +++ b/src/events.c @@ -1453,21 +1453,20 @@ void HandleKey(Key key, int key_status) return; } - if ((key == KSYM_minus || - key == KSYM_plus || - key == KSYM_equal || // ("Shift-=" is "+" on US keyboards) - key == KSYM_0) && - ((GetKeyModState() & KMOD_Control) || - (GetKeyModState() & KMOD_Alt) || - (GetKeyModState() & KMOD_Meta)) && + if ((key == KSYM_0 || key == KSYM_KP_0 || + key == KSYM_minus || key == KSYM_KP_Subtract || + key == KSYM_plus || key == KSYM_KP_Add || + key == KSYM_equal) && // ("Shift-=" is "+" on US keyboards) + (GetKeyModState() & (KMOD_Control | KMOD_Meta)) && video.window_scaling_available && !video.fullscreen_enabled) { - if (key == KSYM_0) + if (key == KSYM_0 || key == KSYM_KP_0) setup.window_scaling_percent = STD_WINDOW_SCALING_PERCENT; + else if (key == KSYM_minus || key == KSYM_KP_Subtract) + setup.window_scaling_percent -= STEP_WINDOW_SCALING_PERCENT; else - setup.window_scaling_percent += - (key == KSYM_minus ? -1 : +1) * STEP_WINDOW_SCALING_PERCENT; + setup.window_scaling_percent += STEP_WINDOW_SCALING_PERCENT; if (setup.window_scaling_percent < MIN_WINDOW_SCALING_PERCENT) setup.window_scaling_percent = MIN_WINDOW_SCALING_PERCENT;