From: Po Lu Date: Wed, 12 Jul 2023 04:46:08 +0000 (+0800) Subject: Fix keyboard state translation on Android X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7a6c7bac6a775a8175edd583018f990625630b17;p=emacs.git Fix keyboard state translation on Android * src/androidterm.c (android_android_to_emacs_modifiers) (android_emacs_to_android_modifiers): Fix statement precedence bugs. --- diff --git a/src/androidterm.c b/src/androidterm.c index 135eda45245..27800a61864 100644 --- a/src/androidterm.c +++ b/src/androidterm.c @@ -362,20 +362,20 @@ static int android_android_to_emacs_modifiers (struct android_display_info *dpyinfo, int state) { - return ((state & ANDROID_CONTROL_MASK) ? ctrl_modifier : 0 - | (state & ANDROID_SHIFT_MASK) ? shift_modifier : 0 - | (state & ANDROID_ALT_MASK) ? meta_modifier : 0 - | (state & ANDROID_SUPER_MASK) ? super_modifier : 0); + return (((state & ANDROID_CONTROL_MASK) ? ctrl_modifier : 0) + | ((state & ANDROID_SHIFT_MASK) ? shift_modifier : 0) + | ((state & ANDROID_ALT_MASK) ? meta_modifier : 0) + | ((state & ANDROID_SUPER_MASK) ? super_modifier : 0)); } static int android_emacs_to_android_modifiers (struct android_display_info *dpyinfo, intmax_t state) { - return ((state & ctrl_modifier) ? ANDROID_CONTROL_MASK : 0 - | (state & shift_modifier) ? ANDROID_SHIFT_MASK : 0 - | (state & meta_modifier) ? ANDROID_ALT_MASK : 0 - | (state & super_modifier) ? ANDROID_SUPER_MASK : 0); + return (((state & ctrl_modifier) ? ANDROID_CONTROL_MASK : 0) + | ((state & shift_modifier) ? ANDROID_SHIFT_MASK : 0) + | ((state & meta_modifier) ? ANDROID_ALT_MASK : 0) + | ((state & super_modifier) ? ANDROID_SUPER_MASK : 0)); } static void android_frame_rehighlight (struct android_display_info *);