File tree Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Expand file tree Collapse file tree 2 files changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,18 @@ pub enum Key {
24
24
Up ,
25
25
Char ( char ) ,
26
26
Super ,
27
+ F1 ,
28
+ F2 ,
29
+ F3 ,
30
+ F4 ,
31
+ F5 ,
32
+ F6 ,
33
+ F7 ,
34
+ F8 ,
35
+ F9 ,
36
+ F10 ,
37
+ F11 ,
38
+ F12 ,
27
39
}
28
40
29
41
mod private {
Original file line number Diff line number Diff line change @@ -34,6 +34,18 @@ const VK_RIGHT: u16 = 0x27;
34
34
const VK_UP : u16 = 0x26 ;
35
35
const VK_DOWN : u16 = 0x28 ;
36
36
const VK_DELETE : u16 = 0x2E ;
37
+ const VK_F1 : u16 = 0x70 ;
38
+ const VK_F2 : u16 = 0x71 ;
39
+ const VK_F3 : u16 = 0x72 ;
40
+ const VK_F4 : u16 = 0x73 ;
41
+ const VK_F5 : u16 = 0x74 ;
42
+ const VK_F6 : u16 = 0x75 ;
43
+ const VK_F7 : u16 = 0x76 ;
44
+ const VK_F8 : u16 = 0x77 ;
45
+ const VK_F9 : u16 = 0x78 ;
46
+ const VK_F10 : u16 = 0x79 ;
47
+ const VK_F11 : u16 = 0x7A ;
48
+ const VK_F12 : u16 = 0x7B ;
37
49
38
50
fn keycode_from_char ( char_as_string : String ) -> Result < WORD , Error > {
39
51
let buf = & mut [ 0 ; 2 ] ;
@@ -73,6 +85,18 @@ fn get_keycode(key: &Key) -> Result<WORD, Error> {
73
85
Key :: Super => VK_LWIN ,
74
86
Key :: Tab => VK_TAB ,
75
87
Key :: Up => VK_UP ,
88
+ Key :: F1 => VK_F1 ,
89
+ Key :: F2 => VK_F2 ,
90
+ Key :: F3 => VK_F3 ,
91
+ Key :: F4 => VK_F4 ,
92
+ Key :: F5 => VK_F5 ,
93
+ Key :: F6 => VK_F6 ,
94
+ Key :: F7 => VK_F7 ,
95
+ Key :: F8 => VK_F8 ,
96
+ Key :: F9 => VK_F9 ,
97
+ Key :: F10 => VK_F10 ,
98
+ Key :: F11 => VK_F11 ,
99
+ Key :: F12 => VK_F12 ,
76
100
} )
77
101
}
78
102
You can’t perform that action at this time.
0 commit comments