]> git.donarmstrong.com Git - kiibohd-controller.git/blob - Output/pjrcUSB/output_com.c
Merge pull request #16 from victorluft/bugfix/consumer_code_release
[kiibohd-controller.git] / Output / pjrcUSB / output_com.c
1 /* Copyright (C) 2011-2015 by Jacob Alexander
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a copy
4  * of this software and associated documentation files (the "Software"), to deal
5  * in the Software without restriction, including without limitation the rights
6  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7  * copies of the Software, and to permit persons to whom the Software is
8  * furnished to do so, subject to the following conditions:
9  *
10  * The above copyright notice and this permission notice shall be included in
11  * all copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19  * THE SOFTWARE.
20  */
21
22 // ----- Includes -----
23
24 // Compiler Includes
25 #include <Lib/OutputLib.h>
26
27 // Project Includes
28 #include <cli.h>
29 #include <led.h>
30 #include <print.h>
31 #include <scan_loop.h>
32
33 // USB Includes
34 #if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_)
35 #include "avr/usb_keyboard_serial.h"
36 #elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_) || defined(_mk20dx256vlh7_)
37 #include "arm/usb_dev.h"
38 #include "arm/usb_keyboard.h"
39 #include "arm/usb_serial.h"
40 #endif
41
42 // Local Includes
43 #include "output_com.h"
44
45
46
47 // ----- Macros -----
48
49 // Used to build a bitmap lookup table from a byte addressable array
50 #define byteLookup( byte ) case (( byte ) * ( 8 )):         bytePosition = byte; byteShift = 0; break; \
51                            case (( byte ) * ( 8 ) + ( 1 )): bytePosition = byte; byteShift = 1; break; \
52                            case (( byte ) * ( 8 ) + ( 2 )): bytePosition = byte; byteShift = 2; break; \
53                            case (( byte ) * ( 8 ) + ( 3 )): bytePosition = byte; byteShift = 3; break; \
54                            case (( byte ) * ( 8 ) + ( 4 )): bytePosition = byte; byteShift = 4; break; \
55                            case (( byte ) * ( 8 ) + ( 5 )): bytePosition = byte; byteShift = 5; break; \
56                            case (( byte ) * ( 8 ) + ( 6 )): bytePosition = byte; byteShift = 6; break; \
57                            case (( byte ) * ( 8 ) + ( 7 )): bytePosition = byte; byteShift = 7; break
58
59
60
61 // ----- Function Declarations -----
62
63 void cliFunc_kbdProtocol( char* args );
64 void cliFunc_outputDebug( char* args );
65 void cliFunc_readLEDs   ( char* args );
66 void cliFunc_sendKeys   ( char* args );
67 void cliFunc_setKeys    ( char* args );
68 void cliFunc_setMod     ( char* args );
69
70
71
72 // ----- Variables -----
73
74 // Output Module command dictionary
75 CLIDict_Entry( kbdProtocol, "Keyboard Protocol Mode: 0 - Boot, 1 - OS/NKRO Mode" );
76 CLIDict_Entry( outputDebug, "Toggle Output Debug mode." );
77 CLIDict_Entry( readLEDs,    "Read LED byte:" NL "\t\t1 NumLck, 2 CapsLck, 4 ScrlLck, 16 Kana, etc." );
78 CLIDict_Entry( sendKeys,    "Send the prepared list of USB codes and modifier byte." );
79 CLIDict_Entry( setKeys,     "Prepare a space separated list of USB codes (decimal). Waits until \033[35msendKeys\033[0m." );
80 CLIDict_Entry( setMod,      "Set the modfier byte:" NL "\t\t1 LCtrl, 2 LShft, 4 LAlt, 8 LGUI, 16 RCtrl, 32 RShft, 64 RAlt, 128 RGUI" );
81
82 CLIDict_Def( outputCLIDict, "USB Module Commands" ) = {
83         CLIDict_Item( kbdProtocol ),
84         CLIDict_Item( outputDebug ),
85         CLIDict_Item( readLEDs ),
86         CLIDict_Item( sendKeys ),
87         CLIDict_Item( setKeys ),
88         CLIDict_Item( setMod ),
89         { 0, 0, 0 } // Null entry for dictionary end
90 };
91
92
93 // Which modifier keys are currently pressed
94 // 1=left ctrl,    2=left shift,   4=left alt,    8=left gui
95 // 16=right ctrl, 32=right shift, 64=right alt, 128=right gui
96          uint8_t  USBKeys_Modifiers    = 0;
97          uint8_t  USBKeys_ModifiersCLI = 0; // Separate CLI send buffer
98
99 // Currently pressed keys, max is defined by USB_MAX_KEY_SEND
100          uint8_t  USBKeys_Keys   [USB_NKRO_BITFIELD_SIZE_KEYS];
101          uint8_t  USBKeys_KeysCLI[USB_NKRO_BITFIELD_SIZE_KEYS]; // Separate CLI send buffer
102
103 // System Control and Consumer Control 1KRO containers
104          uint8_t  USBKeys_SysCtrl;
105          uint16_t USBKeys_ConsCtrl;
106
107 // The number of keys sent to the usb in the array
108          uint8_t  USBKeys_Sent    = 0;
109          uint8_t  USBKeys_SentCLI = 0;
110
111 // 1=num lock, 2=caps lock, 4=scroll lock, 8=compose, 16=kana
112 volatile uint8_t  USBKeys_LEDs = 0;
113
114 // Protocol setting from the host.
115 // 0 - Boot Mode
116 // 1 - NKRO Mode (Default, unless set by a BIOS or boot interface)
117 volatile uint8_t  USBKeys_Protocol = 1;
118
119 // Indicate if USB should send update
120 // OS only needs update if there has been a change in state
121 USBKeyChangeState USBKeys_Changed = USBKeyChangeState_None;
122
123 // the idle configuration, how often we send the report to the
124 // host (ms * 4) even when it hasn't changed
125          uint8_t  USBKeys_Idle_Config = 125;
126
127 // count until idle timeout
128          uint8_t  USBKeys_Idle_Count = 0;
129
130 // Indicates whether the Output module is fully functional
131 // 0 - Not fully functional, 1 - Fully functional
132 // 0 is often used to show that a USB cable is not plugged in (but has power)
133          uint8_t  Output_Available = 0;
134
135 // Debug control variable for Output modules
136 // 0 - Debug disabled (default)
137 // 1 - Debug enabled
138          uint8_t  Output_DebugMode = 0;
139
140
141
142 // ----- Capabilities -----
143
144 // Set Boot Keyboard Protocol
145 void Output_kbdProtocolBoot_capability( uint8_t state, uint8_t stateType, uint8_t *args )
146 {
147         // Display capability name
148         if ( stateType == 0xFF && state == 0xFF )
149         {
150                 print("Output_kbdProtocolBoot()");
151                 return;
152         }
153
154         // Only set if necessary
155         if ( USBKeys_Protocol == 0 )
156                 return;
157
158         // TODO Analog inputs
159         // Only set on key press
160         if ( stateType != 0x01 )
161                 return;
162
163         // Flush the key buffers
164         Output_flushBuffers();
165
166         // Set the keyboard protocol to Boot Mode
167         USBKeys_Protocol = 0;
168 }
169
170
171 // Set NKRO Keyboard Protocol
172 void Output_kbdProtocolNKRO_capability( uint8_t state, uint8_t stateType, uint8_t *args )
173 {
174         // Display capability name
175         if ( stateType == 0xFF && state == 0xFF )
176         {
177                 print("Output_kbdProtocolNKRO()");
178                 return;
179         }
180
181         // Only set if necessary
182         if ( USBKeys_Protocol == 1 )
183                 return;
184
185         // TODO Analog inputs
186         // Only set on key press
187         if ( stateType != 0x01 )
188                 return;
189
190         // Flush the key buffers
191         Output_flushBuffers();
192
193         // Set the keyboard protocol to NKRO Mode
194         USBKeys_Protocol = 1;
195 }
196
197
198 // Sends a Consumer Control code to the USB Output buffer
199 void Output_consCtrlSend_capability( uint8_t state, uint8_t stateType, uint8_t *args )
200 {
201         // Display capability name
202         if ( stateType == 0xFF && state == 0xFF )
203         {
204                 print("Output_consCtrlSend(consCode)");
205                 return;
206         }
207
208         // Not implemented in Boot Mode
209         if ( USBKeys_Protocol == 0 )
210         {
211                 warn_print("Consumer Control is not implemented for Boot Mode");
212                 return;
213         }
214
215         // TODO Analog inputs
216         // Only indicate USB has changed if either a press or release has occured
217         if ( state == 0x01 || state == 0x03 )
218                 USBKeys_Changed |= USBKeyChangeState_Consumer;
219
220         // Only send keypresses if press or hold state
221         if ( stateType == 0x00 && state == 0x03 ) // Release state
222         {
223                 USBKeys_ConsCtrl = 0;
224                 return;
225         }
226
227         // Set consumer control code
228         USBKeys_ConsCtrl = *(uint16_t*)(&args[0]);
229 }
230
231
232 // Sends a System Control code to the USB Output buffer
233 void Output_sysCtrlSend_capability( uint8_t state, uint8_t stateType, uint8_t *args )
234 {
235         // Display capability name
236         if ( stateType == 0xFF && state == 0xFF )
237         {
238                 print("Output_sysCtrlSend(sysCode)");
239                 return;
240         }
241
242         // Not implemented in Boot Mode
243         if ( USBKeys_Protocol == 0 )
244         {
245                 warn_print("System Control is not implemented for Boot Mode");
246                 return;
247         }
248
249         // TODO Analog inputs
250         // Only indicate USB has changed if either a press or release has occured
251         if ( state == 0x01 || state == 0x03 )
252                 USBKeys_Changed |= USBKeyChangeState_System;
253
254         // Only send keypresses if press or hold state
255         if ( stateType == 0x00 && state == 0x03 ) // Release state
256         {
257                 USBKeys_SysCtrl = 0;
258                 return;
259         }
260
261         // Set system control code
262         USBKeys_SysCtrl = args[0];
263 }
264
265
266 // Adds a single USB Code to the USB Output buffer
267 // Argument #1: USB Code
268 void Output_usbCodeSend_capability( uint8_t state, uint8_t stateType, uint8_t *args )
269 {
270         // Display capability name
271         if ( stateType == 0xFF && state == 0xFF )
272         {
273                 print("Output_usbCodeSend(usbCode)");
274                 return;
275         }
276
277         // Depending on which mode the keyboard is in the USB needs Press/Hold/Release events
278         uint8_t keyPress = 0; // Default to key release, only used for NKRO
279         switch ( USBKeys_Protocol )
280         {
281         case 0: // Boot Mode
282                 // TODO Analog inputs
283                 // Only indicate USB has changed if either a press or release has occured
284                 if ( state == 0x01 || state == 0x03 )
285                         USBKeys_Changed = USBKeyChangeState_MainKeys;
286
287                 // Only send keypresses if press or hold state
288                 if ( stateType == 0x00 && state == 0x03 ) // Release state
289                         return;
290                 break;
291         case 1: // NKRO Mode
292                 // Only send press and release events
293                 if ( stateType == 0x00 && state == 0x02 ) // Hold state
294                         return;
295
296                 // Determine if setting or unsetting the bitfield (press == set)
297                 if ( stateType == 0x00 && state == 0x01 ) // Press state
298                         keyPress = 1;
299                 break;
300         }
301
302         // Get the keycode from arguments
303         uint8_t key = args[0];
304
305         // Depending on which mode the keyboard is in, USBKeys_Keys array is used differently
306         // Boot mode - Maximum of 6 byte codes
307         // NKRO mode - Each bit of the 26 byte corresponds to a key
308         //  Bits   0 -  45 (bytes  0 -  5) correspond to USB Codes   4 -  49 (Main)
309         //  Bits  48 - 161 (bytes  6 - 20) correspond to USB Codes  51 - 164 (Secondary)
310         //  Bits 168 - 213 (bytes 21 - 26) correspond to USB Codes 176 - 221 (Tertiary)
311         //  Bits 214 - 216                 unused
312         uint8_t bytePosition = 0;
313         uint8_t byteShift = 0;
314         switch ( USBKeys_Protocol )
315         {
316         case 0: // Boot Mode
317                 // Set the modifier bit if this key is a modifier
318                 if ( (key & 0xE0) == 0xE0 ) // AND with 0xE0 (Left Ctrl, first modifier)
319                 {
320                         USBKeys_Modifiers |= 1 << (key ^ 0xE0); // Left shift 1 by key XOR 0xE0
321                 }
322                 // Normal USB Code
323                 else
324                 {
325                         // USB Key limit reached
326                         if ( USBKeys_Sent >= USB_BOOT_MAX_KEYS )
327                         {
328                                 warn_print("USB Key limit reached");
329                                 return;
330                         }
331
332                         // Make sure key is within the USB HID range
333                         if ( key <= 104 )
334                         {
335                                 USBKeys_Keys[USBKeys_Sent++] = key;
336                         }
337                         // Invalid key
338                         else
339                         {
340                                 warn_msg("USB Code above 104/0x68 in Boot Mode: ");
341                                 printHex( key );
342                                 print( NL );
343                         }
344                 }
345                 break;
346
347         case 1: // NKRO Mode
348                 // Set the modifier bit if this key is a modifier
349                 if ( (key & 0xE0) == 0xE0 ) // AND with 0xE0 (Left Ctrl, first modifier)
350                 {
351                         if ( keyPress )
352                         {
353                                 USBKeys_Modifiers |= 1 << (key ^ 0xE0); // Left shift 1 by key XOR 0xE0
354                         }
355                         else // Release
356                         {
357                                 USBKeys_Modifiers &= ~(1 << (key ^ 0xE0)); // Left shift 1 by key XOR 0xE0
358                         }
359
360                         USBKeys_Changed |= USBKeyChangeState_Modifiers;
361                         break;
362                 }
363                 // First 6 bytes
364                 else if ( key >= 4 && key <= 49 )
365                 {
366                         // Lookup (otherwise division or multiple checks are needed to do alignment)
367                         // Starting at 0th position, each byte has 8 bits, starting at 4th bit
368                         uint8_t keyPos = key + (0 * 8 - 4); // Starting position in array, Ignoring 4 keys
369                         switch ( keyPos )
370                         {
371                                 byteLookup( 0 );
372                                 byteLookup( 1 );
373                                 byteLookup( 2 );
374                                 byteLookup( 3 );
375                                 byteLookup( 4 );
376                                 byteLookup( 5 );
377                         }
378
379                         USBKeys_Changed |= USBKeyChangeState_MainKeys;
380                 }
381                 // Next 14 bytes
382                 else if ( key >= 51 && key <= 155 )
383                 {
384                         // Lookup (otherwise division or multiple checks are needed to do alignment)
385                         // Starting at 6th byte position, each byte has 8 bits, starting at 51st bit
386                         uint8_t keyPos = key + (6 * 8 - 51); // Starting position in array
387                         switch ( keyPos )
388                         {
389                                 byteLookup( 6 );
390                                 byteLookup( 7 );
391                                 byteLookup( 8 );
392                                 byteLookup( 9 );
393                                 byteLookup( 10 );
394                                 byteLookup( 11 );
395                                 byteLookup( 12 );
396                                 byteLookup( 13 );
397                                 byteLookup( 14 );
398                                 byteLookup( 15 );
399                                 byteLookup( 16 );
400                                 byteLookup( 17 );
401                                 byteLookup( 18 );
402                                 byteLookup( 19 );
403                         }
404
405                         USBKeys_Changed |= USBKeyChangeState_SecondaryKeys;
406                 }
407                 // Next byte
408                 else if ( key >= 157 && key <= 164 )
409                 {
410                         // Lookup (otherwise division or multiple checks are needed to do alignment)
411                         uint8_t keyPos = key + (20 * 8 - 157); // Starting position in array, Ignoring 6 keys
412                         switch ( keyPos )
413                         {
414                                 byteLookup( 20 );
415                         }
416
417                         USBKeys_Changed |= USBKeyChangeState_TertiaryKeys;
418                 }
419                 // Last 6 bytes
420                 else if ( key >= 176 && key <= 221 )
421                 {
422                         // Lookup (otherwise division or multiple checks are needed to do alignment)
423                         uint8_t keyPos = key + (21 * 8 - 176); // Starting position in array
424                         switch ( keyPos )
425                         {
426                                 byteLookup( 21 );
427                                 byteLookup( 22 );
428                                 byteLookup( 23 );
429                                 byteLookup( 24 );
430                                 byteLookup( 25 );
431                                 byteLookup( 26 );
432                         }
433
434                         USBKeys_Changed |= USBKeyChangeState_QuartiaryKeys;
435                 }
436                 // Received 0x00
437                 // This is a special USB Code that internally indicates a "break"
438                 // It is used to send "nothing" in order to break up sequences of USB Codes
439                 else if ( key == 0x00 )
440                 {
441                         USBKeys_Changed |= USBKeyChangeState_MainKeys;
442
443                         // Also flush out buffers just in case
444                         Output_flushBuffers();
445                         break;
446                 }
447                 // Invalid key
448                 else
449                 {
450                         warn_msg("USB Code not within 4-49 (0x4-0x31), 51-155 (0x33-0x9B), 157-164 (0x9D-0xA4), 176-221 (0xB0-0xDD) or 224-231 (0xE0-0xE7) NKRO Mode: ");
451                         printHex( key );
452                         print( NL );
453                         break;
454                 }
455
456                 // Set/Unset
457                 if ( keyPress )
458                 {
459                         USBKeys_Keys[bytePosition] |= (1 << byteShift);
460                         USBKeys_Sent++;
461                 }
462                 else // Release
463                 {
464                         USBKeys_Keys[bytePosition] &= ~(1 << byteShift);
465                         USBKeys_Sent++;
466                 }
467
468                 break;
469         }
470 }
471
472
473
474 // ----- Functions -----
475
476 // Flush Key buffers
477 void Output_flushBuffers()
478 {
479         // Zero out USBKeys_Keys array
480         for ( uint8_t c = 0; c < USB_NKRO_BITFIELD_SIZE_KEYS; c++ )
481                 USBKeys_Keys[ c ] = 0;
482
483         // Zero out other key buffers
484         USBKeys_ConsCtrl = 0;
485         USBKeys_Modifiers = 0;
486         USBKeys_SysCtrl = 0;
487 }
488
489
490 // USB Module Setup
491 inline void Output_setup()
492 {
493         // Initialize the USB, and then wait for the host to set configuration.
494         // This will hang forever if USB does not initialize
495         // If no USB cable is attached, does not try and initialize USB
496         if ( usb_init() )
497         {
498                 while ( !usb_configured() );
499         }
500
501         // Register USB Output CLI dictionary
502         CLI_registerDictionary( outputCLIDict, outputCLIDictName );
503
504         // Flush key buffers
505         Output_flushBuffers();
506 }
507
508
509 // USB Data Send
510 inline void Output_send()
511 {
512         // Boot Mode Only, unset stale keys
513         if ( USBKeys_Protocol == 0 )
514                 for ( uint8_t c = USBKeys_Sent; c < USB_BOOT_MAX_KEYS; c++ )
515                         USBKeys_Keys[c] = 0;
516
517         // Send keypresses while there are pending changes
518         while ( USBKeys_Changed )
519                 usb_keyboard_send();
520
521         // Clear keys sent
522         USBKeys_Sent = 0;
523
524         // Signal Scan Module we are finished
525         switch ( USBKeys_Protocol )
526         {
527         case 0: // Boot Mode
528                 // Clear modifiers only in boot mode
529                 USBKeys_Modifiers = 0;
530                 Scan_finishedWithOutput( USBKeys_Sent <= USB_BOOT_MAX_KEYS ? USBKeys_Sent : USB_BOOT_MAX_KEYS );
531                 break;
532         case 1: // NKRO Mode
533                 Scan_finishedWithOutput( USBKeys_Sent );
534                 break;
535         }
536 }
537
538
539 // Sets the device into firmware reload mode
540 inline void Output_firmwareReload()
541 {
542         usb_device_reload();
543 }
544
545
546 // USB Input buffer available
547 inline unsigned int Output_availablechar()
548 {
549         return usb_serial_available();
550 }
551
552
553 // USB Get Character from input buffer
554 inline int Output_getchar()
555 {
556         // XXX Make sure to check output_availablechar() first! Information is lost with the cast (error codes) (AVR)
557         return (int)usb_serial_getchar();
558 }
559
560
561 // USB Send Character to output buffer
562 inline int Output_putchar( char c )
563 {
564         return usb_serial_putchar( c );
565 }
566
567
568 // USB Send String to output buffer, null terminated
569 inline int Output_putstr( char* str )
570 {
571 #if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) // AVR
572         uint16_t count = 0;
573 #elif defined(_mk20dx128_) || defined(_mk20dx128vlf5_) || defined(_mk20dx256_) || defined(_mk20dx256vlh7_) // ARM
574         uint32_t count = 0;
575 #endif
576         // Count characters until NULL character, then send the amount counted
577         while ( str[count] != '\0' )
578                 count++;
579
580         return usb_serial_write( str, count );
581 }
582
583
584 // Soft Chip Reset
585 inline void Output_softReset()
586 {
587         usb_device_software_reset();
588 }
589
590
591 // ----- CLI Command Functions -----
592
593 void cliFunc_kbdProtocol( char* args )
594 {
595         print( NL );
596         info_msg("Keyboard Protocol: ");
597         printInt8( USBKeys_Protocol );
598 }
599
600
601 void cliFunc_outputDebug( char* args )
602 {
603         // Parse number from argument
604         //  NOTE: Only first argument is used
605         char* arg1Ptr;
606         char* arg2Ptr;
607         CLI_argumentIsolation( args, &arg1Ptr, &arg2Ptr );
608
609         // Default to 1 if no argument is given
610         Output_DebugMode = 1;
611
612         if ( arg1Ptr[0] != '\0' )
613         {
614                 Output_DebugMode = (uint16_t)numToInt( arg1Ptr );
615         }
616 }
617
618
619 void cliFunc_readLEDs( char* args )
620 {
621         print( NL );
622         info_msg("LED State: ");
623         printInt8( USBKeys_LEDs );
624 }
625
626
627 void cliFunc_sendKeys( char* args )
628 {
629         // Copy USBKeys_KeysCLI to USBKeys_Keys
630         for ( uint8_t key = 0; key < USBKeys_SentCLI; ++key )
631         {
632                 // TODO
633                 //USBKeys_Keys[key] = USBKeys_KeysCLI[key];
634         }
635         USBKeys_Sent = USBKeys_SentCLI;
636
637         // Set modifier byte
638         USBKeys_Modifiers = USBKeys_ModifiersCLI;
639 }
640
641
642 void cliFunc_setKeys( char* args )
643 {
644         char* curArgs;
645         char* arg1Ptr;
646         char* arg2Ptr = args;
647
648         // Parse up to USBKeys_MaxSize args (whichever is least)
649         for ( USBKeys_SentCLI = 0; USBKeys_SentCLI < USB_BOOT_MAX_KEYS; ++USBKeys_SentCLI )
650         {
651                 curArgs = arg2Ptr;
652                 CLI_argumentIsolation( curArgs, &arg1Ptr, &arg2Ptr );
653
654                 // Stop processing args if no more are found
655                 if ( *arg1Ptr == '\0' )
656                         break;
657
658                 // Add the USB code to be sent
659                 // TODO
660                 //USBKeys_KeysCLI[USBKeys_SentCLI] = numToInt( arg1Ptr );
661         }
662 }
663
664
665 void cliFunc_setMod( char* args )
666 {
667         // Parse number from argument
668         //  NOTE: Only first argument is used
669         char* arg1Ptr;
670         char* arg2Ptr;
671         CLI_argumentIsolation( args, &arg1Ptr, &arg2Ptr );
672
673         USBKeys_ModifiersCLI = numToInt( arg1Ptr );
674 }
675