I found a list indicating some keyboard keys to use in Keyup event, I did not check all but "F2" worked.
Then just change in the if.
Example:
//Verificando se foi acionado a tecla F2
if(e.KeyChar == **113**){
//comandos
}
Follows the list:
8: Put (' [BACKSPACE] on);
9: Place (' [GRT]);
12: Put (' [AM] written);
13: Put (' [ENTER] in);
16: Puts (' [SHIFT] in);
17: Put (' [CONTROL] in);
18: Put (' [AM] written);
20: Put (' [CAPS LOCK] in);
21: Put (' [PAGE UP] in);
27: Set (' [ESC] up);
33: Put (' [PAGE UP] in);
34: Put (' [PAGE DOWN] in);
35: Puts (' [END] in);
36: Place (' [HOME] in);
37: Put (' [LEFT ARROW] in);
38: Place (' [ARROW ABOVE]);
39: Place (' [RIGHT ARROW] Position);
40: Put (' [ARROW BELOW] in);
45: Put (' [INSERT] in);
46: Put (' [DEL] written);
91: Put (' [WIN LEFT] in);
92: Put (' [WIN RIGHT] in);
93: Put (' [POP-UP MENU] in);
96: Place('0&8242;);
97: Place('1&8242;);
98: Place('2&8242;);
99: Place('3&8242;);
100: Place('4&8242;);
101: Put('5&8242;);
102: Place('6&8242;);
103: Place('7&8242;);
104: Place('8&8242;);
105: Place('9&8242;);
106: Places (' [NUM *] );
107: Puts (' [NUM +] in);
109: Puts (' [NUM -] in);
110: Put (' [TO ONE SEP. DECIMAL] in);
111: Put (' [NUM /] above);
112: Put (' [F1] on);
113: Put (' [F2] written);
114: Put (' [F3] written);
115: Put (' [F4] written);
116: Put (' [F5] in);
117: Put (' [F6] written);
118: Put (' [F7] written);
119: Put (' [F8] written);
120: Put (' [F9] in);
121: Place (' [F10] in);
122: Put (' [F11] written);
123: Place (' [F12] in);
144: Places (' [NUM LOCK] on);
186: Place('Ç');
187: Place ('=);
188: Place(',);
189: Place ('-);
190: Put('.);
191: Place(';);
192: Put (' [APOSTROPHE] in);
193: Place ('/);
194: Puts (' [ONE POINT] in);
219: Place (' ');
220: Place (']);
221: Place('[);
222: Place('~);
226: Place(');
Take a look at [tour]. You can accept an answer if it solved your problem. You can vote on every post on the site as well. Did any help you more? You need something to be improved?
– Maniero