From 04f413511029d9351be796ddc3f6c9edf086ea3e Mon Sep 17 00:00:00 2001 From: Tomaka17 Date: Thu, 6 Nov 2014 13:26:42 +0100 Subject: [PATCH] Reorder and add comments to some of the virtual keys --- src/events.rs | 168 +++++++++++++++++++++++++++++--------------------- 1 file changed, 98 insertions(+), 70 deletions(-) diff --git a/src/events.rs b/src/events.rs index 0c11a75d..59f44b45 100644 --- a/src/events.rs +++ b/src/events.rs @@ -65,43 +65,57 @@ pub enum MouseButton { #[deriving(Show, Hash, PartialEq, Eq, Clone)] pub enum VirtualKeyCode { - Key0, + /// The '1' key over the letters. Key1, + /// The '2' key over the letters. Key2, + /// The '3' key over the letters. Key3, + /// The '4' key over the letters. Key4, + /// The '5' key over the letters. Key5, + /// The '6' key over the letters. Key6, + /// The '7' key over the letters. Key7, + /// The '8' key over the letters. Key8, + /// The '9' key over the letters. Key9, + /// The '0' key over the 'O' and 'P' keys. + Key0, + A, - AbntC1, - AbntC2, - Add, - Apostrophe, - Apps, - At, - Ax, B, - Back, - Backslash, C, - Calculator, - Capital, - Colon, - Comma, - Convert, D, - Decimal, - Delete, - Divide, - Down, E, - End, - Equals, - Escape, F, + G, + H, + I, + J, + K, + L, + M, + N, + O, + P, + Q, + R, + S, + T, + U, + V, + W, + X, + Y, + Z, + + /// The Escape key, next to F1. + Escape, + F1, F2, F3, @@ -117,35 +131,35 @@ pub enum VirtualKeyCode { F13, F14, F15, - G, - Grave, - H, - Home, - I, + + /// Print Screen/SysRq. + Snapshot, + /// Scroll Lock. + Scroll, + /// Pause/Break key, next to Scroll lock. + Pause, + + /// `Insert`, next to Backspace. Insert, - J, - K, - Kana, - Kanji, - L, - LAlt, - LBracket, - LControl, + Home, + Delete, + End, + PageDown, + PageUp, + Left, - LMenu, - LShift, - LWin, - M, - Mail, - MediaSelect, - MediaStop, - Minus, - Multiply, - Mute, - MyComputer, - N, - NextTrack, - NoConvert, + Up, + Right, + Down, + + /// The Backspace key, right over Enter. + // TODO: rename + Back, + /// The Enter key. + Return, + /// The space bar. + Space, + Numlock, Numpad0, Numpad1, @@ -157,49 +171,66 @@ pub enum VirtualKeyCode { Numpad7, Numpad8, Numpad9, + + AbntC1, + AbntC2, + Add, + Apostrophe, + Apps, + At, + Ax, + Backslash, + Calculator, + Capital, + Colon, + Comma, + Convert, + Decimal, + Divide, + Equals, + Grave, + Kana, + Kanji, + LAlt, + LBracket, + LControl, + LMenu, + LShift, + LWin, + Mail, + MediaSelect, + MediaStop, + Minus, + Multiply, + Mute, + MyComputer, + NextTrack, + NoConvert, NumpadComma, NumpadEnter, NumpadEquals, - O, OEM102, - P, - PageDown, - PageUp, - Pause, Period, Playpause, Power, Prevtrack, - Q, - R, RAlt, RBracket, RControl, - Return, - Right, RMenu, RShift, RWin, - S, - Scroll, Semicolon, Slash, Sleep, - Snapshot, - Space, Stop, Subtract, Sysrq, - T, Tab, - U, Underline, Unlabeled, - Up, - V, VolumeDown, VolumeUp, - W, Wake, Webback, WebFavorites, @@ -208,8 +239,5 @@ pub enum VirtualKeyCode { WebRefresh, WebSearch, WebStop, - X, - Y, Yen, - Z }