Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(226)

Unified Diff: ui/events/keycodes/dom3/dom_key.h

Issue 641753003: DOM Level 3 .code and .key value enumerations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove generator script Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/events/keycodes/dom3/dom_key.h
diff --git a/ui/events/keycodes/dom3/dom_key.h b/ui/events/keycodes/dom3/dom_key.h
new file mode 100644
index 0000000000000000000000000000000000000000..e843ca7d84a4aa7cdf2c38f46ce339a423bf959e
--- /dev/null
+++ b/ui/events/keycodes/dom3/dom_key.h
@@ -0,0 +1,350 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_EVENTS_KEYCODES_DOM3_DOM_KEY_H_
+#define UI_EVENTS_KEYCODES_DOM3_DOM_KEY_H_
+
+// DOM Level 3 .key value enumeration constants, as defined by:
+//
+// [0] DOM Level 3 KeyboardEvent key Values,
+// http://www.w3.org/TR/DOM-Level-3-Events-key/
+//
+// That reference should be consulted on the meaning and usage of these
+// values; this file does not attempt to describe that.
+//
+// Additional references:
+//
+// [1] Document Object Model (DOM) Level 3 Events Specification,
+// http://www.w3.org/TR/DOM-Level-3-Events/
+// [2] DOM Level 3 KeyboardEvent code Values,
+// http://www.w3.org/TR/DOM-Level-3-Events-code/
+// [3] Legacy Keyboard Event Properties,
+// https://dvcs.w3.org/hg/dom3events/raw-file/tip/html/Note-KeyProps.html
+// [4] USB HID Usage Tables,
+// http://www.usb.org/developers/devclass_docs/Hut1_11.pdf
+// [5] Linux <linux/evdev.h>
+// [6] Windows <ime.h> and <winuser.h>
+// [7] OS X <HIToolbox/Events.h>
+//
+// DOM3 values are defined as text, but numeric values (enum constants) are
+// useful internally, e.g. for IPC or rapid dispatch. The numeric values
+// are chosen for the convenience of the human reader; there is no need
+// in code for these particular numeric values (other than 0 for NONE).
+//
+// The enum identifiers are systematically derived from the W3C names by
+// inserting an underscore between consecutive 'words' and converting to
+// upper case.
+//
+// This file is organized following the sections of [0], and a few integer
+// values are unused between sections to allow for small additions.
+//
+// When adding a value, be sure to add it to the string table in
+// keycode_converter.cc as well.
+
+namespace ui {
+
+enum class DomKey {
Wez 2014/10/31 21:12:52 As for the keycode conversion table, let's have a
kpschoedel 2014/10/31 21:36:52 Sure; I had included explicit values in my origina
+ // Zero is reserved to mean no value; there is no corresponding DOM string.
+ // (This is not the same as the valid DOM .key value 'Unidentified'.)
+ NONE = 0x000,
+
+ // Special Key Values
+ // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-special
+ UNIDENTIFIED = 0x001, // Unidentified
+
+ // Modifier Keys
+ // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-modifier
+ ACCEL = 0x004, // Accel
+ ALT = 0x005, // Alt
+ ALT_GRAPH = 0x006, // AltGraph
+ CAPS_LOCK = 0x007, // CapsLock
+ CONTROL = 0x008, // Control
+ FN = 0x009, // Fn
+ FN_LOCK = 0x00A, // FnLock
+ HYPER = 0x00B, // Hyper
+ META = 0x00C, // Meta
+ NUM_LOCK = 0x00D, // NumLock
+ OS = 0x00E, // OS
+ SCROLL_LOCK = 0x00F, // ScrollLock
+ SHIFT = 0x010, // Shift
+ SUPER = 0x011, // Super
+ SYMBOL = 0x012, // Symbol
+ SYMBOL_LOCK = 0x013, // SymbolLock
+
+ // Whitespace Keys
+ // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-whitespace
+ ENTER = 0x018, // Enter
+ SEPARATOR = 0x019, // Separator
+ TAB = 0x01A, // Tab
+
+ // Navigation Keys
+ // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-navigation
+ ARROW_DOWN = 0x01C, // ArrowDown
+ ARROW_LEFT = 0x01D, // ArrowLeft
+ ARROW_RIGHT = 0x01E, // ArrowRight
+ ARROW_UP = 0x01F, // ArrowUp
+ END = 0x020, // End
+ HOME = 0x021, // Home
+ PAGE_DOWN = 0x022, // PageDown
+ PAGE_UP = 0x023, // PageUp
+
+ // Editing Keys
+ // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-editing
+ BACKSPACE = 0x024, // Backspace
+ CLEAR = 0x025, // Clear
+ COPY = 0x026, // Copy
+ CR_SEL = 0x027, // CrSel
+ CUT = 0x028, // Cut
+ DELETE = 0x029, // Delete
+ ERASE_EOF = 0x02A, // EraseEof
+ EX_SEL = 0x02B, // ExSel
+ INSERT = 0x02C, // Insert
+ PASTE = 0x02D, // Paste
+ REDO = 0x02E, // Redo
+ UNDO = 0x02F, // Undo
+
+ // UI Keys
+ // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-ui
+ ACCEPT = 0x030, // Accept
+ AGAIN = 0x031, // Again
+ ATTN = 0x032, // Attn
+ CANCEL = 0x033, // Cancel
+ CONTEXT_MENU = 0x034, // ContextMenu
+ ESCAPE = 0x035, // Escape
+ EXECUTE = 0x036, // Execute
+ FIND = 0x037, // Find
+ HELP = 0x038, // Help
+ PAUSE = 0x039, // Pause
+ PLAY = 0x03A, // Play
+ PROPS = 0x03B, // Props
+ SELECT = 0x03C, // Select
+ ZOOM_IN = 0x03D, // ZoomIn
+ ZOOM_OUT = 0x03E, // ZoomOut
+
+ // Device Keys
+ // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-device
+ BRIGHTNESS_DOWN = 0x040, // BrightnessDown
+ BRIGHTNESS_UP = 0x041, // BrightnessUp
+ CAMERA = 0x042, // Camera
+ EJECT = 0x043, // Eject
+ LOG_OFF = 0x044, // LogOff
+ POWER = 0x045, // Power
+ POWER_OFF = 0x046, // PowerOff
+ PRINT_SCREEN = 0x047, // PrintScreen
+ HIBERNATE = 0x048, // Hibernate
+ STANDBY = 0x049, // Standby
+ WAKE_UP = 0x04A, // WakeUp
+
+ // IME and Composition Keys
+ // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-composition
+ ALL_CANDIDATES = 0x050, // AllCandidates
+ ALPHANUMERIC = 0x051, // Alphanumeric
+ CODE_INPUT = 0x052, // CodeInput
+ COMPOSE = 0x053, // Compose
+ CONVERT = 0x054, // Convert
+ DEAD = 0x055, // Dead
+ FINAL_MODE = 0x056, // FinalMode
+ GROUP_FIRST = 0x057, // GroupFirst
+ GROUP_LAST = 0x058, // GroupLast
+ GROUP_NEXT = 0x059, // GroupNext
+ GROUP_PREVIOUS = 0x05A, // GroupPrevious
+ MODE_CHANGE = 0x05B, // ModeChange
+ NEXT_CANDIDATE = 0x05C, // NextCandidate
+ NON_CONVERT = 0x05D, // NonConvert
+ PREVIOUS_CANDIDATE = 0x05E, // PreviousCandidate
+ PROCESS = 0x05F, // Process
+ SINGLE_CANDIDATE = 0x060, // SingleCandidate
+
+ // Keys specific to Korean keyboards:
+ HANGUL_MODE = 0x063, // HangulMode
+ HANJA_MODE = 0x064, // HanjaMode
+ JUNJA_MODE = 0x065, // JunjaMode
+
+ // Keys specific to Japanese keyboards
+ EISU = 0x066, // Eisu
+ HANKAKU = 0x067, // Hankaku
+ HIRAGANA = 0x068, // Hiragana
+ HIRAGANA_KATAKANA = 0x069, // HiraganaKatakana
+ KANA_MODE = 0x06A, // KanaMode
+ KANJI_MODE = 0x06B, // KanjiMode
+ KATAKANA = 0x06C, // Katakana
+ ROMAJI = 0x06D, // Romaji
+ ZENKAKU = 0x06E, // Zenkaku
+ ZENKAKU_HANKAKU = 0x06F, // ZenkakuHankaku
+
+ // General-Purpose Function Keys
+ // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-function
+ //
+ // DOM defines open-ended sets, but if we want a finite numeric encoding we
+ // need to draw the line somewhere. USB and Windows (VK) and Linux (evdev) all
+ // support 24, so we define 24 and optimistically leave space for another 8.
+ // For soft keys, we define 8 and leave consecutive space for 8.
+ F1 = 0x071, // F1
+ F2 = 0x072, // F2
+ F3 = 0x073, // F3
+ F4 = 0x074, // F4
+ F5 = 0x075, // F5
+ F6 = 0x076, // F6
+ F7 = 0x077, // F7
+ F8 = 0x078, // F8
+ F9 = 0x079, // F9
+ F10 = 0x07A, // F10
+ F11 = 0x07B, // F11
+ F12 = 0x07C, // F12
+ F13 = 0x07D, // F13
+ F14 = 0x07E, // F14
+ F15 = 0x07F, // F15
+ F16 = 0x080, // F16
+ F17 = 0x081, // F17
+ F18 = 0x082, // F18
+ F19 = 0x083, // F19
+ F20 = 0x084, // F20
+ F21 = 0x085, // F21
+ F22 = 0x086, // F22
+ F23 = 0x087, // F23
+ F24 = 0x088, // F24
+
+ SOFT1 = 0x091, // Soft1
+ SOFT2 = 0x092, // Soft2
+ SOFT3 = 0x093, // Soft3
+ SOFT4 = 0x094, // Soft4
+ SOFT5 = 0x095, // Soft5
+ SOFT6 = 0x096, // Soft6
+ SOFT7 = 0x097, // Soft7
+ SOFT8 = 0x098, // Soft8
+ CLOSE = 0x0A0, // Close
+
+ // Multimedia Keys
+ // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-multimedia
+ MAIL_FORWARD = 0x0A1, // MailForward
+ MAIL_REPLY = 0x0A2, // MailReply
+ MAIL_SEND = 0x0A3, // MailSend
+ MEDIA_PLAY_PAUSE = 0x0A4, // MediaPlayPause
+ MEDIA_SELECT = 0x0A5, // MediaSelect
+ MEDIA_STOP = 0x0A6, // MediaStop
+ MEDIA_TRACK_NEXT = 0x0A7, // MediaTrackNext
+ MEDIA_TRACK_PREVIOUS = 0x0A8, // MediaTrackPrevious
+ NEW = 0x0A9, // New
+ OPEN = 0x0AA, // Open
+ PRINT = 0x0AB, // Print
+ SAVE = 0x0AC, // Save
+ SPELL_CHECK = 0x0AD, // SpellCheck
+ VOLUME_DOWN = 0x0B0, // VolumeDown
+ VOLUME_UP = 0x0B1, // VolumeUp
+ VOLUME_MUTE = 0x0B2, // VolumeMute
+
+ // Application Keys
+ // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-apps
+ LAUNCH_CALCULATOR = 0x0C0, // LaunchCalculator
+ LAUNCH_CALENDAR = 0x0C1, // LaunchCalendar
+ LAUNCH_MAIL = 0x0C2, // LaunchMail
+ LAUNCH_MEDIA_PLAYER = 0x0C3, // LaunchMediaPlayer
+ LAUNCH_MUSIC_PLAYER = 0x0C4, // LaunchMusicPlayer
+ LAUNCH_MY_COMPUTER = 0x0C5, // LaunchMyComputer
+ LAUNCH_SCREEN_SAVER = 0x0C6, // LaunchScreenSaver
+ LAUNCH_SPREADSHEET = 0x0C7, // LaunchSpreadsheet
+ LAUNCH_WEB_BROWSER = 0x0C8, // LaunchWebBrowser
+ LAUNCH_WEB_CAM = 0x0C9, // LaunchWebCam
+ LAUNCH_WORD_PROCESSOR = 0x0CA, // LaunchWordProcessor
+
+ // Browser Keys
+ // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-browser
+ BROWSER_BACK = 0x0D0, // BrowserBack
+ BROWSER_FAVORITES = 0x0D1, // BrowserFavorites
+ BROWSER_FORWARD = 0x0D2, // BrowserForward
+ BROWSER_HOME = 0x0D3, // BrowserHome
+ BROWSER_REFRESH = 0x0D4, // BrowserRefresh
+ BROWSER_SEARCH = 0x0D5, // BrowserSearch
+ BROWSER_STOP = 0x0D6, // BrowserStop
+
+ // Media Controller Keys
+ // http://www.w3.org/TR/DOM-Level-3-Events-key/#keys-media-controller
+ AUDIO_BALANCE_LEFT = 0x0D9, // AudioBalanceLeft
+ AUDIO_BALANCE_RIGHT = 0x0DA, // AudioBalanceRight
+ AUDIO_BASS_BOOST_DOWN = 0x0DB, // AudioBassBoostDown
+ AUDIO_BASS_BOOST_UP = 0x0DC, // AudioBassBoostUp
+ AUDIO_FADER_FRONT = 0x0DD, // AudioFaderFront
+ AUDIO_FADER_REAR = 0x0DE, // AudioFaderRear
+ AUDIO_SURROUND_MODE_NEXT = 0x0DF, // AudioSurroundModeNext
+
+ AVR_INPUT = 0x0E0, // AVRInput
+ AVR_POWER = 0x0E1, // AVRPower
+ CHANNEL_DOWN = 0x0E2, // ChannelDown
+ CHANNEL_UP = 0x0E3, // ChannelUp
+ COLOR_F0_RED = 0x0E4, // ColorF0Red
+ COLOR_F1_GREEN = 0x0E5, // ColorF1Green
+ COLOR_F2_YELLOW = 0x0E6, // ColorF2Yellow
+ COLOR_F3_BLUE = 0x0E7, // ColorF3Blue
+ COLOR_F4_GREY = 0x0E8, // ColorF4Grey
+ COLOR_F5_BROWN = 0x0E9, // ColorF5Brown
+ CLOSED_CAPTION_TOGGLE = 0x0EA, // ClosedCaptionToggle
+ DIMMER = 0x0EB, // Dimmer
+ DISPLAY_SWAP = 0x0EC, // DisplaySwap
+ EXIT = 0x0ED, // Exit
+
+ FAVORITE_CLEAR0 = 0x0F0, // FavoriteClear0
+ FAVORITE_CLEAR1 = 0x0F1, // FavoriteClear1
+ FAVORITE_CLEAR2 = 0x0F2, // FavoriteClear2
+ FAVORITE_CLEAR3 = 0x0F3, // FavoriteClear3
+ FAVORITE_RECALL0 = 0x0F4, // FavoriteRecall0
+ FAVORITE_RECALL1 = 0x0F5, // FavoriteRecall1
+ FAVORITE_RECALL2 = 0x0F6, // FavoriteRecall2
+ FAVORITE_RECALL3 = 0x0F7, // FavoriteRecall3
+ FAVORITE_STORE0 = 0x0F8, // FavoriteStore0
+ FAVORITE_STORE1 = 0x0F9, // FavoriteStore1
+ FAVORITE_STORE2 = 0x0FA, // FavoriteStore2
+ FAVORITE_STORE3 = 0x0FB, // FavoriteStore3
+ GUIDE = 0x0FC, // Guide
+ GUIDE_NEXT_DAY = 0x0FD, // GuideNextDay
+ GUIDE_PREVIOUS_DAY = 0x0FE, // GuidePreviousDay
+ INFO = 0x0FF, // Info
+
+ INSTANT_REPLAY = 0x100, // InstantReplay
+ LINK = 0x101, // Link
+ LIST_PROGRAM = 0x102, // ListProgram
+ LIVE_CONTENT = 0x103, // LiveContent
+ LOCK = 0x104, // Lock
+ MEDIA_APPS = 0x108, // MediaApps
+ MEDIA_FAST_FORWARD = 0x109, // MediaFastForward
+ MEDIA_LAST = 0x10A, // MediaLast
+ MEDIA_PAUSE = 0x10B, // MediaPause
+ MEDIA_PLAY = 0x10C, // MediaPlay
+ MEDIA_RECORD = 0x10D, // MediaRecord
+ MEDIA_REWIND = 0x10E, // MediaRewind
+ MEDIA_SKIP = 0x10F, // MediaSkip
+
+ NEXT_FAVORITE_CHANNEL = 0x110, // NextFavoriteChannel
+ NEXT_USER_PROFILE = 0x111, // NextUserProfile
+ ON_DEMAND = 0x112, // OnDemand
+ PIN_P_DOWN = 0x113, // PinPDown
+ PIN_P_MOVE = 0x114, // PinPMove
+ PIN_P_TOGGLE = 0x115, // PinPToggle
+ PIN_P_UP = 0x116, // PinPUp
+ PLAY_SPEED_DOWN = 0x117, // PlaySpeedDown
+ PLAY_SPEED_RESET = 0x118, // PlaySpeedReset
+ PLAY_SPEED_UP = 0x119, // PlaySpeedUp
+ RANDOM_TOGGLE = 0x11A, // RandomToggle
+ RC_LOW_BATTERY = 0x11B, // RcLowBattery
+ RECORD_SPEED_NEXT = 0x11C, // RecordSpeedNext
+ RF_BYPASS = 0x11D, // RfBypass
+ SCAN_CHANNELS_TOGGLE = 0x11E, // ScanChannelsToggle
+ SCREEN_MODE_NEXT = 0x11F, // ScreenModeNext
+
+ SETTINGS = 0x120, // Settings
+ SPLIT_SCREEN_TOGGLE = 0x121, // SplitScreenToggle
+ STB_INPUT = 0x122, // STBInput
+ STB_POWER = 0x123, // STBPower
+ SUBTITLE = 0x124, // Subtitle
+ TELETEXT = 0x125, // Teletext
+ TV = 0x126, // TV
+ TV_INPUT = 0x127, // TVInput
+ TV_POWER = 0x128, // TVPower
+ VIDEO_MODE_NEXT = 0x129, // VideoModeNext
+ WINK = 0x12A, // Wink
+ ZOOM_TOGGLE = 0x12B, // ZoomToggle
+};
+
+} // namespace ui
+
+#endif // UI_EVENTS_KEYCODES_DOM3_DOM_KEY_H_

Powered by Google App Engine
This is Rietveld 408576698