diff options
Diffstat (limited to 'chrome/browser/views/accelerator_table_gtk.cc')
-rw-r--r-- | chrome/browser/views/accelerator_table_gtk.cc | 208 |
1 files changed, 93 insertions, 115 deletions
diff --git a/chrome/browser/views/accelerator_table_gtk.cc b/chrome/browser/views/accelerator_table_gtk.cc index 7579769..4a24493 100644 --- a/chrome/browser/views/accelerator_table_gtk.cc +++ b/chrome/browser/views/accelerator_table_gtk.cc @@ -2,140 +2,118 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include <gdk/gdkkeysyms.h> -#include <X11/XF86keysym.h> - #include "chrome/browser/views/accelerator_table_gtk.h" #include "base/basictypes.h" +#include "base/keyboard_codes.h" #include "chrome/app/chrome_dll_resource.h" namespace browser { const AcceleratorMapping kAcceleratorMap[] = { // Focus. - { GDK_k, IDC_FOCUS_SEARCH, GDK_CONTROL_MASK }, - { GDK_e, IDC_FOCUS_SEARCH, GDK_CONTROL_MASK }, - { XF86XK_Search, IDC_FOCUS_SEARCH, GdkModifierType(0) }, - { GDK_l, IDC_FOCUS_LOCATION, GDK_CONTROL_MASK }, - { GDK_d, IDC_FOCUS_LOCATION, GDK_MOD1_MASK }, - { GDK_F6, IDC_FOCUS_LOCATION, GdkModifierType(0) }, - { XF86XK_OpenURL, IDC_FOCUS_LOCATION, GdkModifierType(0) }, - { XF86XK_Go, IDC_FOCUS_LOCATION, GdkModifierType(0) }, + { base::VKEY_K, false, true, false, IDC_FOCUS_SEARCH }, + { base::VKEY_E, false, true, false, IDC_FOCUS_SEARCH }, + { base::VKEY_BROWSER_SEARCH, false, false, false, IDC_FOCUS_SEARCH }, + { base::VKEY_L, false, true, false, IDC_FOCUS_LOCATION }, + { base::VKEY_D, false, false, true, IDC_FOCUS_LOCATION }, + { base::VKEY_F6, false, false, false, IDC_FOCUS_LOCATION }, // Tab/window controls. - { GDK_t, IDC_NEW_TAB, GDK_CONTROL_MASK }, - { GDK_n, IDC_NEW_WINDOW, GDK_CONTROL_MASK }, - { GDK_n, IDC_NEW_INCOGNITO_WINDOW, - GdkModifierType(GDK_CONTROL_MASK | GDK_SHIFT_MASK) }, - { GDK_Page_Down, IDC_SELECT_NEXT_TAB, GDK_CONTROL_MASK }, - { GDK_Page_Up, IDC_SELECT_PREVIOUS_TAB, GDK_CONTROL_MASK }, - { GDK_w, IDC_CLOSE_TAB, GDK_CONTROL_MASK }, - { GDK_t, IDC_RESTORE_TAB, - GdkModifierType(GDK_CONTROL_MASK | GDK_SHIFT_MASK) }, - - { GDK_1, IDC_SELECT_TAB_0, GDK_CONTROL_MASK }, - { GDK_2, IDC_SELECT_TAB_1, GDK_CONTROL_MASK }, - { GDK_3, IDC_SELECT_TAB_2, GDK_CONTROL_MASK }, - { GDK_4, IDC_SELECT_TAB_3, GDK_CONTROL_MASK }, - { GDK_5, IDC_SELECT_TAB_4, GDK_CONTROL_MASK }, - { GDK_6, IDC_SELECT_TAB_5, GDK_CONTROL_MASK }, - { GDK_7, IDC_SELECT_TAB_6, GDK_CONTROL_MASK }, - { GDK_8, IDC_SELECT_TAB_7, GDK_CONTROL_MASK }, - { GDK_9, IDC_SELECT_LAST_TAB, GDK_CONTROL_MASK }, - - { GDK_1, IDC_SELECT_TAB_0, GDK_MOD1_MASK }, - { GDK_2, IDC_SELECT_TAB_1, GDK_MOD1_MASK }, - { GDK_3, IDC_SELECT_TAB_2, GDK_MOD1_MASK }, - { GDK_4, IDC_SELECT_TAB_3, GDK_MOD1_MASK }, - { GDK_5, IDC_SELECT_TAB_4, GDK_MOD1_MASK }, - { GDK_6, IDC_SELECT_TAB_5, GDK_MOD1_MASK }, - { GDK_7, IDC_SELECT_TAB_6, GDK_MOD1_MASK }, - { GDK_8, IDC_SELECT_TAB_7, GDK_MOD1_MASK }, - { GDK_9, IDC_SELECT_LAST_TAB, GDK_MOD1_MASK }, - - { GDK_KP_1, IDC_SELECT_TAB_0, GDK_CONTROL_MASK }, - { GDK_KP_2, IDC_SELECT_TAB_1, GDK_CONTROL_MASK }, - { GDK_KP_3, IDC_SELECT_TAB_2, GDK_CONTROL_MASK }, - { GDK_KP_4, IDC_SELECT_TAB_3, GDK_CONTROL_MASK }, - { GDK_KP_5, IDC_SELECT_TAB_4, GDK_CONTROL_MASK }, - { GDK_KP_6, IDC_SELECT_TAB_5, GDK_CONTROL_MASK }, - { GDK_KP_7, IDC_SELECT_TAB_6, GDK_CONTROL_MASK }, - { GDK_KP_8, IDC_SELECT_TAB_7, GDK_CONTROL_MASK }, - { GDK_KP_9, IDC_SELECT_LAST_TAB, GDK_CONTROL_MASK }, - - { GDK_KP_1, IDC_SELECT_TAB_0, GDK_MOD1_MASK }, - { GDK_KP_2, IDC_SELECT_TAB_1, GDK_MOD1_MASK }, - { GDK_KP_3, IDC_SELECT_TAB_2, GDK_MOD1_MASK }, - { GDK_KP_4, IDC_SELECT_TAB_3, GDK_MOD1_MASK }, - { GDK_KP_5, IDC_SELECT_TAB_4, GDK_MOD1_MASK }, - { GDK_KP_6, IDC_SELECT_TAB_5, GDK_MOD1_MASK }, - { GDK_KP_7, IDC_SELECT_TAB_6, GDK_MOD1_MASK }, - { GDK_KP_8, IDC_SELECT_TAB_7, GDK_MOD1_MASK }, - { GDK_KP_9, IDC_SELECT_LAST_TAB, GDK_MOD1_MASK }, - - { GDK_F4, IDC_CLOSE_TAB, GDK_CONTROL_MASK }, - { GDK_F4, IDC_CLOSE_WINDOW, GDK_MOD1_MASK }, + { base::VKEY_T, false, true, false, IDC_NEW_TAB }, + { base::VKEY_N, false, true, false, IDC_NEW_WINDOW }, + { base::VKEY_N, true, true, false, IDC_NEW_INCOGNITO_WINDOW }, + { base::VKEY_DOWN, false, true, false, IDC_SELECT_NEXT_TAB }, + { base::VKEY_UP, false, true, false, IDC_SELECT_PREVIOUS_TAB }, + { base::VKEY_W, false, true, false, IDC_CLOSE_TAB }, + { base::VKEY_T, true, true, false, IDC_RESTORE_TAB }, + + { base::VKEY_1, false, true, false, IDC_SELECT_TAB_0 }, + { base::VKEY_2, false, true, false, IDC_SELECT_TAB_1 }, + { base::VKEY_3, false, true, false, IDC_SELECT_TAB_2 }, + { base::VKEY_4, false, true, false, IDC_SELECT_TAB_3 }, + { base::VKEY_5, false, true, false, IDC_SELECT_TAB_4 }, + { base::VKEY_6, false, true, false, IDC_SELECT_TAB_5 }, + { base::VKEY_7, false, true, false, IDC_SELECT_TAB_6 }, + { base::VKEY_8, false, true, false, IDC_SELECT_TAB_7 }, + { base::VKEY_9, false, true, false, IDC_SELECT_LAST_TAB }, + + { base::VKEY_1, false, false, true, IDC_SELECT_TAB_0 }, + { base::VKEY_2, false, false, true, IDC_SELECT_TAB_1 }, + { base::VKEY_3, false, false, true, IDC_SELECT_TAB_2 }, + { base::VKEY_4, false, false, true, IDC_SELECT_TAB_3 }, + { base::VKEY_5, false, false, true, IDC_SELECT_TAB_4 }, + { base::VKEY_6, false, false, true, IDC_SELECT_TAB_5 }, + { base::VKEY_7, false, false, true, IDC_SELECT_TAB_6 }, + { base::VKEY_8, false, false, true, IDC_SELECT_TAB_7 }, + { base::VKEY_9, false, false, true, IDC_SELECT_LAST_TAB }, + + { base::VKEY_NUMPAD1, false, true, false, IDC_SELECT_TAB_0 }, + { base::VKEY_NUMPAD2, false, true, false, IDC_SELECT_TAB_1 }, + { base::VKEY_NUMPAD3, false, true, false, IDC_SELECT_TAB_2 }, + { base::VKEY_NUMPAD4, false, true, false, IDC_SELECT_TAB_3 }, + { base::VKEY_NUMPAD5, false, true, false, IDC_SELECT_TAB_4 }, + { base::VKEY_NUMPAD6, false, true, false, IDC_SELECT_TAB_5 }, + { base::VKEY_NUMPAD7, false, true, false, IDC_SELECT_TAB_6 }, + { base::VKEY_NUMPAD8, false, true, false, IDC_SELECT_TAB_7 }, + { base::VKEY_NUMPAD9, false, true, false, IDC_SELECT_LAST_TAB }, + + { base::VKEY_NUMPAD1, false, false, true, IDC_SELECT_TAB_0 }, + { base::VKEY_NUMPAD2, false, false, true, IDC_SELECT_TAB_1 }, + { base::VKEY_NUMPAD3, false, false, true, IDC_SELECT_TAB_2 }, + { base::VKEY_NUMPAD4, false, false, true, IDC_SELECT_TAB_3 }, + { base::VKEY_NUMPAD5, false, false, true, IDC_SELECT_TAB_4 }, + { base::VKEY_NUMPAD6, false, false, true, IDC_SELECT_TAB_5 }, + { base::VKEY_NUMPAD7, false, false, true, IDC_SELECT_TAB_6 }, + { base::VKEY_NUMPAD8, false, false, true, IDC_SELECT_TAB_7 }, + { base::VKEY_NUMPAD9, false, false, true, IDC_SELECT_LAST_TAB }, + + { base::VKEY_F4, false, true, false, IDC_CLOSE_TAB }, + { base::VKEY_F4, false, false, true, IDC_CLOSE_WINDOW }, // Zoom level. - { GDK_plus, IDC_ZOOM_PLUS, - GdkModifierType(GDK_CONTROL_MASK | GDK_SHIFT_MASK) }, - { GDK_equal, IDC_ZOOM_PLUS, GDK_CONTROL_MASK }, - { XF86XK_ZoomIn, IDC_ZOOM_PLUS, GdkModifierType(0) }, - { GDK_0, IDC_ZOOM_NORMAL, GDK_CONTROL_MASK }, - { GDK_minus, IDC_ZOOM_MINUS, GDK_CONTROL_MASK }, - { GDK_underscore, IDC_ZOOM_MINUS, - GdkModifierType(GDK_CONTROL_MASK | GDK_SHIFT_MASK) }, - { XF86XK_ZoomOut, IDC_ZOOM_MINUS, GdkModifierType(0) }, + { base::VKEY_OEM_PLUS, false, true, false, IDC_ZOOM_PLUS }, + { base::VKEY_OEM_PLUS, true, true, false, IDC_ZOOM_PLUS }, + { base::VKEY_0, false, true, false, IDC_ZOOM_NORMAL }, + { base::VKEY_OEM_MINUS, false, true, false, IDC_ZOOM_MINUS }, + { base::VKEY_OEM_MINUS, true, true, false, IDC_ZOOM_MINUS }, // Find in page. - { GDK_g, IDC_FIND_NEXT, GDK_CONTROL_MASK }, - { GDK_F3, IDC_FIND_NEXT, GdkModifierType(0) }, - { GDK_g, IDC_FIND_PREVIOUS, - GdkModifierType(GDK_CONTROL_MASK | GDK_SHIFT_MASK) }, - { GDK_F3, IDC_FIND_PREVIOUS, GDK_SHIFT_MASK }, + { base::VKEY_F, false, true, false, IDC_FIND }, + { base::VKEY_G, false, true, false, IDC_FIND_NEXT }, + { base::VKEY_F3, false, false, false, IDC_FIND_NEXT }, + { base::VKEY_G, true, true, false, IDC_FIND_PREVIOUS }, + { base::VKEY_F3, true, false, false, IDC_FIND_PREVIOUS }, // Navigation / toolbar buttons. - { GDK_Home, IDC_HOME, GDK_MOD1_MASK }, - { XF86XK_HomePage, IDC_HOME, GdkModifierType(0) }, - { GDK_Escape, IDC_STOP, GdkModifierType(0) }, - { XF86XK_Stop, IDC_STOP, GdkModifierType(0) }, - { GDK_Left, IDC_BACK, GDK_MOD1_MASK }, - { GDK_BackSpace, IDC_BACK, GdkModifierType(0) }, - { XF86XK_Back, IDC_BACK, GdkModifierType(0) }, - { GDK_Right, IDC_FORWARD, GDK_MOD1_MASK }, - { GDK_BackSpace, IDC_FORWARD, GDK_SHIFT_MASK }, - { XF86XK_Forward, IDC_FORWARD, GdkModifierType(0) }, - { GDK_r, IDC_RELOAD, GDK_CONTROL_MASK }, - { GDK_F5, IDC_RELOAD, GdkModifierType(0) }, - { GDK_F5, IDC_RELOAD, GDK_CONTROL_MASK }, - { GDK_F5, IDC_RELOAD, GDK_SHIFT_MASK }, - { XF86XK_Reload, IDC_RELOAD, GdkModifierType(0) }, - { XF86XK_Refresh, IDC_RELOAD, GdkModifierType(0) }, + { base::VKEY_HOME, false, false, true, IDC_HOME }, + { base::VKEY_ESCAPE, false, false, false, IDC_STOP }, + { base::VKEY_LEFT, false, false, true, IDC_BACK }, + { base::VKEY_BACK, false, false, false, IDC_BACK }, + { base::VKEY_RIGHT, false, false, true, IDC_FORWARD }, + { base::VKEY_BACK, true, false, false, IDC_FORWARD }, + { base::VKEY_R, false, true, false, IDC_RELOAD }, + { base::VKEY_F5, false, false, false, IDC_RELOAD }, + { base::VKEY_F5, false, true, false, IDC_RELOAD }, + { base::VKEY_F5, true, false, false, IDC_RELOAD }, // Miscellany. - { GDK_d, IDC_STAR, GDK_CONTROL_MASK }, - { XF86XK_AddFavorite, IDC_STAR, GdkModifierType(0) }, - { XF86XK_Favorites, IDC_SHOW_BOOKMARK_BAR, GdkModifierType(0) }, - { GDK_b, IDC_SHOW_BOOKMARK_BAR, GDK_CONTROL_MASK }, - { XF86XK_History, IDC_SHOW_HISTORY, GdkModifierType(0) }, - { GDK_h, IDC_SHOW_HISTORY, GDK_CONTROL_MASK }, - { GDK_j, IDC_SHOW_DOWNLOADS, GDK_CONTROL_MASK }, - { GDK_o, IDC_OPEN_FILE, GDK_CONTROL_MASK }, - { GDK_F11, IDC_FULLSCREEN, GdkModifierType(0) }, - { GDK_u, IDC_VIEW_SOURCE, GDK_CONTROL_MASK }, - { GDK_j, IDC_DEV_TOOLS, GdkModifierType(GDK_CONTROL_MASK | GDK_MOD1_MASK) }, - { GDK_p, IDC_PRINT, GDK_CONTROL_MASK }, - { GDK_Escape, IDC_TASK_MANAGER, GDK_SHIFT_MASK }, - { GDK_f, IDC_FULLSCREEN, - GdkModifierType(GDK_CONTROL_MASK | GDK_MOD1_MASK) }, - { GDK_Delete, IDC_TASK_MANAGER, - GdkModifierType(GDK_CONTROL_MASK | GDK_MOD1_MASK) }, - { GDK_comma, IDC_CONTROL_PANEL, GdkModifierType(GDK_CONTROL_MASK) }, - { GDK_b, IDC_SHOW_BOOKMARK_MANAGER, - GdkModifierType(GDK_CONTROL_MASK | GDK_SHIFT_MASK) }, - { GDK_F1, IDC_HELP_PAGE, GdkModifierType(0) }, - { GDK_q, IDC_EXIT, GdkModifierType(GDK_CONTROL_MASK | GDK_SHIFT_MASK) }, + { base::VKEY_D, false, true, false, IDC_STAR }, + { base::VKEY_B, false, true, false, IDC_SHOW_BOOKMARK_BAR }, + { base::VKEY_H, false, true, false, IDC_SHOW_HISTORY }, + { base::VKEY_J, false, true, false, IDC_SHOW_DOWNLOADS }, + { base::VKEY_O, false, true, false, IDC_OPEN_FILE }, + { base::VKEY_F11, false, false, false, IDC_FULLSCREEN }, + { base::VKEY_U, false, true, false, IDC_VIEW_SOURCE }, + { base::VKEY_J, true, true, false, IDC_DEV_TOOLS }, + { base::VKEY_P, false, true, false, IDC_PRINT}, + { base::VKEY_ESCAPE, true, false, false, IDC_TASK_MANAGER }, + { base::VKEY_F11, false, true, true, IDC_FULLSCREEN }, + { base::VKEY_DELETE, false, true, true, IDC_TASK_MANAGER }, + { base::VKEY_OEM_COMMA, false, true, false, IDC_CONTROL_PANEL }, + { base::VKEY_B, true, true, false, IDC_SHOW_BOOKMARK_MANAGER }, + { base::VKEY_F1, false, false, false, IDC_HELP_PAGE }, + { base::VKEY_Q, true, true, false, IDC_EXIT }, }; const size_t kAcceleratorMapLength = arraysize(kAcceleratorMap); |