Rename GDK_MOD1_MASK to GDK_ALT_MASK

We've hardcoded Mod1 = Alt for a long time, there is
no need to keep the confusing naming around anymore.
This commit is contained in:
Matthias Clasen 2020-04-05 09:39:03 -04:00
parent e8f30c836d
commit b02db72e17
34 changed files with 92 additions and 92 deletions

View File

@ -78,7 +78,7 @@ const GDK_CROSSING_UNGRAB = 2;
const GDK_SHIFT_MASK = 1 << 0;
const GDK_LOCK_MASK = 1 << 1;
const GDK_CONTROL_MASK = 1 << 2;
const GDK_MOD1_MASK = 1 << 3;
const GDK_ALT_MASK = 1 << 3;
const GDK_MOD2_MASK = 1 << 4;
const GDK_MOD3_MASK = 1 << 5;
const GDK_MOD4_MASK = 1 << 6;
@ -1383,13 +1383,13 @@ function updateKeyboardStatus() {
}
function updateForEvent(ev) {
lastState &= ~(GDK_SHIFT_MASK|GDK_CONTROL_MASK|GDK_MOD1_MASK);
lastState &= ~(GDK_SHIFT_MASK|GDK_CONTROL_MASK|GDK_ALT_MASK);
if (ev.shiftKey)
lastState |= GDK_SHIFT_MASK;
if (ev.ctrlKey)
lastState |= GDK_CONTROL_MASK;
if (ev.altKey)
lastState |= GDK_MOD1_MASK;
lastState |= GDK_ALT_MASK;
lastTimeStamp = ev.timeStamp;
}

View File

@ -2318,7 +2318,7 @@ gdk_event_get_match (GdkEvent *event,
accel_mods = gdk_event_get_modifier_state (event);
if (accel_key == GDK_KEY_Sys_Req &&
(accel_mods & GDK_MOD1_MASK) != 0)
(accel_mods & GDK_ALT_MASK) != 0)
{
/* HACK: we don't want to use SysRq as a keybinding (but we do
* want Alt+Print), so we avoid translation from Alt+Print to SysRq

View File

@ -558,7 +558,7 @@ gdk_keymap_lookup_key (GdkKeymap *keymap,
*
* |[<!-- language="C" -->
* // We want to ignore irrelevant modifiers like ScrollLock
* #define ALL_ACCELS_MASK (GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK)
* #define ALL_ACCELS_MASK (GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_ALT_MASK)
* state = gdk_event_get_modifier_state (event);
* gdk_keymap_translate_keyboard_state (keymap,
* gdk_key_event_get_keycode (event),
@ -685,13 +685,13 @@ gdk_keymap_real_get_modifier_mask (GdkKeymap *keymap,
return GDK_CONTROL_MASK;
case GDK_MODIFIER_INTENT_NO_TEXT_INPUT:
return GDK_MOD1_MASK | GDK_CONTROL_MASK;
return GDK_ALT_MASK | GDK_CONTROL_MASK;
case GDK_MODIFIER_INTENT_SHIFT_GROUP:
return 0;
case GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK:
return (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK |
return (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_ALT_MASK |
GDK_SUPER_MASK | GDK_HYPER_MASK | GDK_META_MASK);
default:
@ -708,7 +708,7 @@ gdk_keymap_real_get_modifier_mask (GdkKeymap *keymap,
* uses for a particular purpose.
*
* Note that this function always returns real hardware modifiers, not
* virtual ones (e.g. it will return #GDK_MOD1_MASK rather than
* virtual ones (e.g. it will return #GDK_ALT_MASK rather than
* #GDK_META_MASK if the backend maps MOD1 to META), so there are use
* cases where the return value of this function has to be transformed
* by gdk_keymap_add_virtual_modifiers() in order to contain the

View File

@ -199,7 +199,7 @@ typedef enum
* @GDK_LOCK_MASK: a Lock key (depending on the modifier mapping of the
* X server this may either be CapsLock or ShiftLock).
* @GDK_CONTROL_MASK: the Control key.
* @GDK_MOD1_MASK: the fourth modifier key (it depends on the modifier
* @GDK_ALT_MASK: the fourth modifier key (it depends on the modifier
* mapping of the X server which key is interpreted as this modifier, but
* normally it is the Alt key).
* @GDK_MOD2_MASK: the fifth modifier key (it depends on the modifier
@ -259,7 +259,7 @@ typedef enum
GDK_SHIFT_MASK = 1 << 0,
GDK_LOCK_MASK = 1 << 1,
GDK_CONTROL_MASK = 1 << 2,
GDK_MOD1_MASK = 1 << 3,
GDK_ALT_MASK = 1 << 3,
GDK_MOD2_MASK = 1 << 4,
GDK_MOD3_MASK = 1 << 5,
GDK_MOD4_MASK = 1 << 6,

View File

@ -288,7 +288,7 @@ get_keyboard_modifiers_from_ns_flags (NSUInteger nsflags)
if (nsflags & NSControlKeyMask)
modifiers |= GDK_CONTROL_MASK;
if (nsflags & NSAlternateKeyMask)
modifiers |= GDK_MOD1_MASK;
modifiers |= GDK_ALT_MASK;
if (nsflags & NSCommandKeyMask)
modifiers |= GDK_MOD2_MASK;
@ -1162,7 +1162,7 @@ fill_key_event (GdkSurface *window,
break;
case GDK_KEY_Alt_R:
case GDK_KEY_Alt_L:
mask = GDK_MOD1_MASK;
mask = GDK_ALT_MASK;
break;
case GDK_KEY_Control_R:
case GDK_KEY_Control_L:
@ -1280,7 +1280,7 @@ _gdk_quartz_events_get_current_keyboard_modifiers (void)
if (carbon_modifiers & controlKey)
modifiers |= GDK_CONTROL_MASK;
if (carbon_modifiers & optionKey)
modifiers |= GDK_MOD1_MASK;
modifiers |= GDK_ALT_MASK;
if (carbon_modifiers & cmdKey)
modifiers |= GDK_MOD2_MASK;

View File

@ -757,10 +757,10 @@ gdk_quartz_keymap_get_modifier_mask (GdkKeymap *keymap,
return GDK_MOD2_MASK | GDK_CONTROL_MASK;
case GDK_MODIFIER_INTENT_SHIFT_GROUP:
return GDK_MOD1_MASK;
return GDK_ALT_MASK;
case GDK_MODIFIER_INTENT_DEFAULT_MOD_MASK:
return (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_MOD1_MASK |
return (GDK_SHIFT_MASK | GDK_CONTROL_MASK | GDK_ALT_MASK |
GDK_MOD2_MASK | GDK_SUPER_MASK | GDK_HYPER_MASK |
GDK_META_MASK);

View File

@ -258,7 +258,7 @@ get_xkb_modifiers (struct xkb_keymap *xkb_keymap,
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_CAPS);
if (state & GDK_CONTROL_MASK)
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_CTRL);
if (state & GDK_MOD1_MASK)
if (state & GDK_ALT_MASK)
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_ALT);
if (state & GDK_MOD2_MASK)
mods |= 1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_NUM);
@ -291,7 +291,7 @@ get_gdk_modifiers (struct xkb_keymap *xkb_keymap,
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_CTRL)))
state |= GDK_CONTROL_MASK;
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_ALT)))
state |= GDK_MOD1_MASK;
state |= GDK_ALT_MASK;
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, XKB_MOD_NAME_NUM)))
state |= GDK_MOD2_MASK;
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, "Mod3")))
@ -310,7 +310,7 @@ get_gdk_modifiers (struct xkb_keymap *xkb_keymap,
* rely on that behavior.
*/
if (mods & (1 << xkb_keymap_mod_get_index (xkb_keymap, "Meta")) &&
(state & GDK_MOD1_MASK) == 0)
(state & GDK_ALT_MASK) == 0)
state |= GDK_META_MASK;
return state;

View File

@ -79,7 +79,7 @@ get_current_mask (void)
if (kbd[VK_CONTROL] & 0x80)
mask |= GDK_CONTROL_MASK;
if (kbd[VK_MENU] & 0x80)
mask |= GDK_MOD1_MASK;
mask |= GDK_ALT_MASK;
if (kbd[VK_LBUTTON] & 0x80)
mask |= GDK_BUTTON1_MASK;
if (kbd[VK_MBUTTON] & 0x80)

View File

@ -54,7 +54,7 @@ get_current_mask (void)
if (kbd[VK_CONTROL] & 0x80)
mask |= GDK_CONTROL_MASK;
if (kbd[VK_MENU] & 0x80)
mask |= GDK_MOD1_MASK;
mask |= GDK_ALT_MASK;
if (kbd[VK_LBUTTON] & 0x80)
mask |= GDK_BUTTON1_MASK;
if (kbd[VK_MBUTTON] & 0x80)

View File

@ -844,7 +844,7 @@ get_modifier_key_state (void)
if (GetKeyState (VK_SHIFT) < 0)
state |= GDK_SHIFT_MASK;
if (GetKeyState (VK_MENU) < 0)
state |= GDK_MOD1_MASK;
state |= GDK_ALT_MASK;
if (GetKeyState (VK_CAPITAL) & 0x1)
state |= GDK_LOCK_MASK;

View File

@ -1869,7 +1869,7 @@ manufacture_keystate_from_GMT (GdkModifierType state)
{
DWORD key_state = 0;
if (state & GDK_MOD1_MASK)
if (state & GDK_ALT_MASK)
key_state |= MK_ALT;
if (state & GDK_CONTROL_MASK)
key_state |= MK_CONTROL;
@ -2415,22 +2415,22 @@ gdk_dnd_handle_key_event (GdkDrag *drag,
case GDK_KEY_Up:
case GDK_KEY_KP_Up:
dy = (state & GDK_MOD1_MASK) ? -BIG_STEP : -SMALL_STEP;
dy = (state & GDK_ALT_MASK) ? -BIG_STEP : -SMALL_STEP;
break;
case GDK_KEY_Down:
case GDK_KEY_KP_Down:
dy = (state & GDK_MOD1_MASK) ? BIG_STEP : SMALL_STEP;
dy = (state & GDK_ALT_MASK) ? BIG_STEP : SMALL_STEP;
break;
case GDK_KEY_Left:
case GDK_KEY_KP_Left:
dx = (state & GDK_MOD1_MASK) ? -BIG_STEP : -SMALL_STEP;
dx = (state & GDK_ALT_MASK) ? -BIG_STEP : -SMALL_STEP;
break;
case GDK_KEY_Right:
case GDK_KEY_KP_Right:
dx = (state & GDK_MOD1_MASK) ? BIG_STEP : SMALL_STEP;
dx = (state & GDK_ALT_MASK) ? BIG_STEP : SMALL_STEP;
break;
}
}

View File

@ -662,14 +662,14 @@ build_key_event_state (BYTE *key_state)
if (key_state[VK_RCONTROL] & 0x80)
state |= GDK_CONTROL_MASK;
if (key_state[VK_LMENU] & 0x80)
state |= GDK_MOD1_MASK;
state |= GDK_ALT_MASK;
}
else
{
if (key_state[VK_CONTROL] & 0x80)
state |= GDK_CONTROL_MASK;
if (key_state[VK_MENU] & 0x80)
state |= GDK_MOD1_MASK;
state |= GDK_ALT_MASK;
}
return state;
@ -724,7 +724,7 @@ build_pointer_event_state (MSG *msg)
state |= GDK_SHIFT_MASK;
if (GetKeyState (VK_MENU) < 0)
state |= GDK_MOD1_MASK;
state |= GDK_ALT_MASK;
if (GetKeyState (VK_CAPITAL) & 0x1)
state |= GDK_LOCK_MASK;
@ -741,7 +741,7 @@ print_event_state (guint state)
CASE (SHIFT);
CASE (LOCK);
CASE (CONTROL);
CASE (MOD1);
CASE (ALT);
CASE (MOD2);
CASE (MOD3);
CASE (MOD4);
@ -2326,9 +2326,9 @@ gdk_event_translate (MSG *msg,
both_shift_pressed[0] = both_shift_pressed[1] = 0;
}
/* Reset MOD1_MASK if it is the Alt key itself */
/* Reset ALT_MASK if it is the Alt key itself */
if (msg->wParam == VK_MENU)
state &= ~GDK_MOD1_MASK;
state &= ~GDK_ALT_MASK;
event = gdk_event_key_new ((msg->message == WM_KEYDOWN || msg->message == WM_SYSKEYDOWN)
? GDK_KEY_PRESS

View File

@ -2148,7 +2148,7 @@ gdk_drag_get_current_actions (GdkModifierType state,
{
*possible_actions = actions;
if ((state & (GDK_MOD1_MASK)) && (actions & GDK_ACTION_ASK))
if ((state & (GDK_ALT_MASK)) && (actions & GDK_ACTION_ASK))
*suggested_action = GDK_ACTION_ASK;
else if (actions & GDK_ACTION_COPY)
*suggested_action = GDK_ACTION_COPY;
@ -2237,22 +2237,22 @@ gdk_dnd_handle_key_event (GdkDrag *drag,
case GDK_KEY_Up:
case GDK_KEY_KP_Up:
dy = (state & GDK_MOD1_MASK) ? -BIG_STEP : -SMALL_STEP;
dy = (state & GDK_ALT_MASK) ? -BIG_STEP : -SMALL_STEP;
break;
case GDK_KEY_Down:
case GDK_KEY_KP_Down:
dy = (state & GDK_MOD1_MASK) ? BIG_STEP : SMALL_STEP;
dy = (state & GDK_ALT_MASK) ? BIG_STEP : SMALL_STEP;
break;
case GDK_KEY_Left:
case GDK_KEY_KP_Left:
dx = (state & GDK_MOD1_MASK) ? -BIG_STEP : -SMALL_STEP;
dx = (state & GDK_ALT_MASK) ? -BIG_STEP : -SMALL_STEP;
break;
case GDK_KEY_Right:
case GDK_KEY_KP_Right:
dx = (state & GDK_MOD1_MASK) ? BIG_STEP : SMALL_STEP;
dx = (state & GDK_ALT_MASK) ? BIG_STEP : SMALL_STEP;
break;
default:

View File

@ -401,7 +401,7 @@ update_keymaps (GdkX11Keymap *keymap_x11)
keymap_x11->modmap[i / keymap_x11->mod_keymap->max_keypermod] |= mask;
/* The fourth modifier, GDK_MOD1_MASK is 1 << 3.
/* The fourth modifier, GDK_ALT_MASK is 1 << 3.
* Each group of max_keypermod entries refers to the same modifier.
*/
mask = 1 << (i / keymap_x11->mod_keymap->max_keypermod);
@ -427,7 +427,7 @@ update_keymaps (GdkX11Keymap *keymap_x11)
case GDK_CONTROL_MASK:
case GDK_SHIFT_MASK:
case GDK_MOD1_MASK:
case GDK_ALT_MASK:
/* Some keyboard maps are known to map Mode_Switch as an
* extra Mod1 key. In circumstances like that, it won't be
* used to switch groups.

View File

@ -267,7 +267,7 @@ gtk_button_accessible_get_keybinding (AtkAction *action,
{
key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label));
if (key_val != GDK_KEY_VoidSymbol)
return_value = gtk_accelerator_name (key_val, GDK_MOD1_MASK);
return_value = gtk_accelerator_name (key_val, GDK_ALT_MASK);
}
if (return_value == NULL)
{
@ -294,7 +294,7 @@ gtk_button_accessible_get_keybinding (AtkAction *action,
{
key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label));
if (key_val != GDK_KEY_VoidSymbol)
return_value = gtk_accelerator_name (key_val, GDK_MOD1_MASK);
return_value = gtk_accelerator_name (key_val, GDK_ALT_MASK);
}
}
return return_value;

View File

@ -287,7 +287,7 @@ gtk_combo_box_accessible_get_keybinding (AtkAction *action,
{
key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label));
if (key_val != GDK_KEY_VoidSymbol)
return_value = gtk_accelerator_name (key_val, GDK_MOD1_MASK);
return_value = gtk_accelerator_name (key_val, GDK_ALT_MASK);
}
return return_value;

View File

@ -1533,7 +1533,7 @@ gtk_entry_accessible_get_keybinding (AtkAction *action,
{
key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label));
if (key_val != GDK_KEY_VoidSymbol)
return gtk_accelerator_name (key_val, GDK_MOD1_MASK);
return gtk_accelerator_name (key_val, GDK_ALT_MASK);
}
return NULL;

View File

@ -258,7 +258,7 @@ gtk_expander_accessible_get_keybinding (AtkAction *action,
key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label));
if (key_val != GDK_KEY_VoidSymbol)
return_value = gtk_accelerator_name (key_val, GDK_MOD1_MASK);
return_value = gtk_accelerator_name (key_val, GDK_ALT_MASK);
}
return return_value;

View File

@ -963,7 +963,7 @@ gtk_text_accessible_get_keybinding (AtkAction *action,
{
key_val = gtk_label_get_mnemonic_keyval (GTK_LABEL (label));
if (key_val != GDK_KEY_VoidSymbol)
return gtk_accelerator_name (key_val, GDK_MOD1_MASK);
return gtk_accelerator_name (key_val, GDK_ALT_MASK);
}
return NULL;

View File

@ -338,7 +338,7 @@ gtk_accelerator_parse_with_keycode (const gchar *accelerator,
else if (len >= 6 && is_modx (accelerator))
{
static const guint mod_vals[] = {
GDK_MOD1_MASK, GDK_MOD2_MASK, GDK_MOD3_MASK,
GDK_ALT_MASK, GDK_MOD2_MASK, GDK_MOD3_MASK,
GDK_MOD4_MASK, GDK_MOD5_MASK
};
@ -357,7 +357,7 @@ gtk_accelerator_parse_with_keycode (const gchar *accelerator,
{
accelerator += 5;
len -= 5;
mods |= GDK_MOD1_MASK;
mods |= GDK_ALT_MASK;
}
else if (len >= 6 && is_meta (accelerator))
{
@ -598,7 +598,7 @@ gtk_accelerator_name (guint accelerator_key,
static const gchar text_primary[] = "<Primary>";
static const gchar text_shift[] = "<Shift>";
static const gchar text_control[] = "<Control>";
static const gchar text_mod1[] = "<Alt>";
static const gchar text_alt[] = "<Alt>";
static const gchar text_mod2[] = "<Mod2>";
static const gchar text_mod3[] = "<Mod3>";
static const gchar text_mod4[] = "<Mod4>";
@ -628,8 +628,8 @@ gtk_accelerator_name (guint accelerator_key,
l += sizeof (text_shift) - 1;
if (accelerator_mods & GDK_CONTROL_MASK)
l += sizeof (text_control) - 1;
if (accelerator_mods & GDK_MOD1_MASK)
l += sizeof (text_mod1) - 1;
if (accelerator_mods & GDK_ALT_MASK)
l += sizeof (text_alt) - 1;
if (accelerator_mods & GDK_MOD2_MASK)
l += sizeof (text_mod2) - 1;
if (accelerator_mods & GDK_MOD3_MASK)
@ -667,10 +667,10 @@ gtk_accelerator_name (guint accelerator_key,
strcpy (accelerator + l, text_control);
l += sizeof (text_control) - 1;
}
if (accelerator_mods & GDK_MOD1_MASK)
if (accelerator_mods & GDK_ALT_MASK)
{
strcpy (accelerator + l, text_mod1);
l += sizeof (text_mod1) - 1;
strcpy (accelerator + l, text_alt);
l += sizeof (text_alt) - 1;
}
if (accelerator_mods & GDK_MOD2_MASK)
{
@ -945,7 +945,7 @@ gtk_accelerator_print_label (GString *gstring,
seen_mod = TRUE;
}
if (accelerator_mods & GDK_MOD1_MASK)
if (accelerator_mods & GDK_ALT_MASK)
{
if (seen_mod)
append_separator (gstring);
@ -1098,7 +1098,7 @@ gtk_accelerator_print_label (GString *gstring,
* Sets the modifiers that will be considered significant for keyboard
* accelerators. The default mod mask depends on the GDK backend in use,
* but will typically include #GDK_CONTROL_MASK | #GDK_SHIFT_MASK |
* #GDK_MOD1_MASK | #GDK_SUPER_MASK | #GDK_HYPER_MASK | #GDK_META_MASK.
* #GDK_ALT_MASK | #GDK_SUPER_MASK | #GDK_HYPER_MASK | #GDK_META_MASK.
* In other words, Control, Shift, Alt, Super, Hyper and Meta. Other
* modifiers will by default be ignored by #GtkAccelGroup.
*
@ -1112,7 +1112,7 @@ void
gtk_accelerator_set_default_mod_mask (GdkModifierType default_mod_mask)
{
default_accel_mod_mask = (default_mod_mask & GDK_MODIFIER_MASK) |
(GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK);
(GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_ALT_MASK);
}
/**
@ -1135,7 +1135,7 @@ gtk_accelerator_get_default_mod_mask (void)
display = gdk_display_get_default ();
if (!display)
return GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_MOD1_MASK;
return GDK_CONTROL_MASK | GDK_SHIFT_MASK | GDK_ALT_MASK;
default_accel_mod_mask =
gdk_display_get_modifier_mask (display,

View File

@ -346,7 +346,7 @@ icon_loaded (GObject *object,
modifiers |= NSShiftKeyMask;
if (mask & GDK_CONTROL_MASK)
modifiers |= NSControlKeyMask;
if (mask & GDK_MOD1_MASK)
if (mask & GDK_ALT_MASK)
modifiers |= NSAlternateKeyMask;
if (mask & GDK_META_MASK)
modifiers |= NSCommandKeyMask;

View File

@ -321,7 +321,7 @@ key_controller_key_pressed (GtkEventControllerKey *controller,
GtkColorPlane *plane = GTK_COLOR_PLANE (widget);
gdouble step;
if ((state & GDK_MOD1_MASK) != 0)
if ((state & GDK_ALT_MASK) != 0)
step = 0.1;
else
step = 0.01;

View File

@ -561,20 +561,20 @@ gtk_combo_box_class_init (GtkComboBoxClass *klass)
/* key bindings */
gtk_widget_class_add_binding_signal (widget_class,
GDK_KEY_Down, GDK_MOD1_MASK,
GDK_KEY_Down, GDK_ALT_MASK,
"popup",
NULL);
gtk_widget_class_add_binding_signal (widget_class,
GDK_KEY_KP_Down, GDK_MOD1_MASK,
GDK_KEY_KP_Down, GDK_ALT_MASK,
"popup",
NULL);
gtk_widget_class_add_binding_signal (widget_class,
GDK_KEY_Up, GDK_MOD1_MASK,
GDK_KEY_Up, GDK_ALT_MASK,
"popdown",
NULL);
gtk_widget_class_add_binding_signal (widget_class,
GDK_KEY_KP_Up, GDK_MOD1_MASK,
GDK_KEY_KP_Up, GDK_ALT_MASK,
"popdown",
NULL);
gtk_widget_class_add_binding_signal (widget_class,

View File

@ -7500,29 +7500,29 @@ gtk_file_chooser_widget_class_init (GtkFileChooserWidgetClass *class)
NULL);
add_normal_and_shifted_binding (widget_class,
GDK_KEY_Up, GDK_MOD1_MASK,
GDK_KEY_Up, GDK_ALT_MASK,
"up-folder");
add_normal_and_shifted_binding (widget_class,
GDK_KEY_KP_Up, GDK_MOD1_MASK,
GDK_KEY_KP_Up, GDK_ALT_MASK,
"up-folder");
add_normal_and_shifted_binding (widget_class,
GDK_KEY_Down, GDK_MOD1_MASK,
GDK_KEY_Down, GDK_ALT_MASK,
"down-folder");
add_normal_and_shifted_binding (widget_class,
GDK_KEY_KP_Down, GDK_MOD1_MASK,
GDK_KEY_KP_Down, GDK_ALT_MASK,
"down-folder");
gtk_widget_class_add_binding_signal (widget_class,
GDK_KEY_Home, GDK_MOD1_MASK,
GDK_KEY_Home, GDK_ALT_MASK,
"home-folder",
NULL);
gtk_widget_class_add_binding_signal (widget_class,
GDK_KEY_KP_Home, GDK_MOD1_MASK,
GDK_KEY_KP_Home, GDK_ALT_MASK,
"home-folder",
NULL);
gtk_widget_class_add_binding_signal (widget_class,
GDK_KEY_d, GDK_MOD1_MASK,
GDK_KEY_d, GDK_ALT_MASK,
"desktop-folder",
NULL);
gtk_widget_class_add_binding_signal (widget_class,
@ -7530,7 +7530,7 @@ gtk_file_chooser_widget_class_init (GtkFileChooserWidgetClass *class)
"show-hidden",
NULL);
gtk_widget_class_add_binding_signal (widget_class,
GDK_KEY_s, GDK_MOD1_MASK,
GDK_KEY_s, GDK_ALT_MASK,
"search-shortcut",
NULL);
gtk_widget_class_add_binding_signal (widget_class,
@ -7538,11 +7538,11 @@ gtk_file_chooser_widget_class_init (GtkFileChooserWidgetClass *class)
"search-shortcut",
NULL);
gtk_widget_class_add_binding_signal (widget_class,
GDK_KEY_r, GDK_MOD1_MASK,
GDK_KEY_r, GDK_ALT_MASK,
"recent-shortcut",
NULL);
gtk_widget_class_add_binding_signal (widget_class,
GDK_KEY_p, GDK_MOD1_MASK,
GDK_KEY_p, GDK_ALT_MASK,
"places-shortcut",
NULL);
gtk_widget_class_add_binding (widget_class,
@ -7564,7 +7564,7 @@ gtk_file_chooser_widget_class_init (GtkFileChooserWidgetClass *class)
for (i = 0; i < G_N_ELEMENTS (quick_bookmark_keyvals); i++)
gtk_widget_class_add_binding_signal (widget_class,
quick_bookmark_keyvals[i], GDK_MOD1_MASK,
quick_bookmark_keyvals[i], GDK_ALT_MASK,
"quick-bookmark",
"(i)", i);

View File

@ -1090,10 +1090,10 @@ gtk_label_class_init (GtkLabelClass *class)
"move-cursor",
"(iib)", GTK_MOVEMENT_PARAGRAPH_ENDS, 0, FALSE);
add_move_binding (widget_class, GDK_KEY_f, GDK_MOD1_MASK,
add_move_binding (widget_class, GDK_KEY_f, GDK_ALT_MASK,
GTK_MOVEMENT_WORDS, 1);
add_move_binding (widget_class, GDK_KEY_b, GDK_MOD1_MASK,
add_move_binding (widget_class, GDK_KEY_b, GDK_ALT_MASK,
GTK_MOVEMENT_WORDS, -1);
add_move_binding (widget_class, GDK_KEY_Home, 0,

View File

@ -968,11 +968,11 @@ add_reorder_bindings (GtkWidgetClass *widget_class,
guint keypad_keysym = keysym - GDK_KEY_Left + GDK_KEY_KP_Left;
gtk_widget_class_add_binding_signal (widget_class,
keysym, GDK_MOD1_MASK,
keysym, GDK_ALT_MASK,
"reorder_tab",
"(ib)", direction, move_to_last);
gtk_widget_class_add_binding_signal (widget_class,
keypad_keysym, GDK_MOD1_MASK,
keypad_keysym, GDK_ALT_MASK,
"reorder_tab",
"(ib)", direction, move_to_last);
}
@ -1349,11 +1349,11 @@ gtk_notebook_class_init (GtkNotebookClass *class)
"(i)", 1);
gtk_widget_class_add_binding_signal (widget_class,
GDK_KEY_Page_Up, GDK_CONTROL_MASK | GDK_MOD1_MASK,
GDK_KEY_Page_Up, GDK_CONTROL_MASK | GDK_ALT_MASK,
"change-current-page",
"(i)", -1);
gtk_widget_class_add_binding_signal (widget_class,
GDK_KEY_Page_Down, GDK_CONTROL_MASK | GDK_MOD1_MASK,
GDK_KEY_Page_Down, GDK_CONTROL_MASK | GDK_ALT_MASK,
"change-current-page",
"(i)", 1);

View File

@ -3061,7 +3061,7 @@ on_key_pressed (GtkEventControllerKey *controller,
}
if (keyval == GDK_KEY_Down &&
(state & modifiers) == GDK_MOD1_MASK)
(state & modifiers) == GDK_ALT_MASK)
return eject_or_unmount_selection (sidebar);
if ((keyval == GDK_KEY_Delete ||

View File

@ -600,7 +600,7 @@ gtk_popover_has_mnemonic_modifier_pressed (GtkPopover *popover)
GdkModifierType mask;
gdk_device_get_state (dev, priv->surface, NULL, &mask);
if ((mask & gtk_accelerator_get_default_mod_mask ()) == GDK_MOD1_MASK)
if ((mask & gtk_accelerator_get_default_mod_mask ()) == GDK_ALT_MASK)
{
retval = TRUE;
break;
@ -678,7 +678,7 @@ update_mnemonics_visible (GtkPopover *popover,
return;
if ((keyval == GDK_KEY_Alt_L || keyval == GDK_KEY_Alt_R) &&
((state & (gtk_accelerator_get_default_mod_mask ()) & ~(GDK_MOD1_MASK)) == 0))
((state & (gtk_accelerator_get_default_mod_mask ()) & ~(GDK_ALT_MASK)) == 0))
{
if (visible)
gtk_popover_schedule_mnemonics_visible (popover);

View File

@ -550,7 +550,7 @@ gtk_search_entry_is_keynav (guint keyval,
keyval == GDK_KEY_End || keyval == GDK_KEY_KP_End ||
keyval == GDK_KEY_Page_Up || keyval == GDK_KEY_KP_Page_Up ||
keyval == GDK_KEY_Page_Down || keyval == GDK_KEY_KP_Page_Down ||
((state & (GDK_CONTROL_MASK | GDK_MOD1_MASK)) != 0))
((state & (GDK_CONTROL_MASK | GDK_ALT_MASK)) != 0))
return TRUE;
/* Other navigation events should get automatically

View File

@ -513,7 +513,7 @@ gtk_shortcut_controller_class_init (GtkShortcutControllerClass *klass)
P_("Mnemonic modifers"),
P_("The modifiers to be pressed to allow mnemonics activation"),
GDK_TYPE_MODIFIER_TYPE,
GDK_MOD1_MASK,
GDK_ALT_MASK,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
@ -547,7 +547,7 @@ gtk_shortcut_controller_class_init (GtkShortcutControllerClass *klass)
static void
gtk_shortcut_controller_init (GtkShortcutController *self)
{
self->mnemonics_modifiers = GDK_MOD1_MASK;
self->mnemonics_modifiers = GDK_ALT_MASK;
}
void

View File

@ -137,7 +137,7 @@ get_labels (guint key, GdkModifierType modifier, guint *n_mods)
labels[i++] = C_("keyboard label", "Shift");
if (modifier & GDK_CONTROL_MASK)
labels[i++] = C_("keyboard label", "Ctrl");
if (modifier & GDK_MOD1_MASK)
if (modifier & GDK_ALT_MASK)
labels[i++] = C_("keyboard label", "Alt");
if (modifier & GDK_MOD2_MASK)
labels[i++] = "Mod2";

View File

@ -5348,7 +5348,7 @@ gtk_tree_view_key_controller_key_pressed (GtkEventControllerKey *key,
}
if (focus_column &&
(state & GDK_SHIFT_MASK) && (state & GDK_MOD1_MASK) &&
(state & GDK_SHIFT_MASK) && (state & GDK_ALT_MASK) &&
(keyval == GDK_KEY_Left || keyval == GDK_KEY_KP_Left
|| keyval == GDK_KEY_Right || keyval == GDK_KEY_KP_Right))
{
@ -5380,7 +5380,7 @@ gtk_tree_view_key_controller_key_pressed (GtkEventControllerKey *key,
}
if (focus_column &&
(state & GDK_MOD1_MASK) &&
(state & GDK_ALT_MASK) &&
(keyval == GDK_KEY_Left || keyval == GDK_KEY_KP_Left
|| keyval == GDK_KEY_Right || keyval == GDK_KEY_KP_Right
|| keyval == GDK_KEY_Home || keyval == GDK_KEY_KP_Home

View File

@ -5238,7 +5238,7 @@ gtk_window_has_mnemonic_modifier_pressed (GtkWindow *window)
GdkModifierType mask;
gdk_device_get_state (dev, priv->surface, NULL, &mask);
if ((mask & gtk_accelerator_get_default_mod_mask ()) == GDK_MOD1_MASK)
if ((mask & gtk_accelerator_get_default_mod_mask ()) == GDK_ALT_MASK)
{
retval = TRUE;
break;
@ -5287,7 +5287,7 @@ update_mnemonics_visible (GtkWindow *window,
gboolean visible)
{
if ((keyval == GDK_KEY_Alt_L || keyval == GDK_KEY_Alt_R) &&
((state & (gtk_accelerator_get_default_mod_mask ()) & ~(GDK_MOD1_MASK)) == 0))
((state & (gtk_accelerator_get_default_mod_mask ()) & ~(GDK_ALT_MASK)) == 0))
{
if (visible)
_gtk_window_schedule_mnemonics_visible (window);

View File

@ -171,7 +171,7 @@ test_trigger_parse_keyval (void)
guint keyval;
int trigger_type;
} tests[] = {
{ "<Primary><Alt>z", GDK_CONTROL_MASK | GDK_MOD1_MASK, 'z' },
{ "<Primary><Alt>z", GDK_CONTROL_MASK | GDK_ALT_MASK, 'z' },
{ "<Control>U", GDK_CONTROL_MASK, 'u' },
{ "<Hyper>x", GDK_HYPER_MASK, 'x' },
{ "<Meta>y", GDK_META_MASK, 'y' },