arduino_keyboardlib
arduino_keyboardlib copied to clipboard
Keyboard.h file found
Hi,
I cannot use your library, Arduino finds standard Keyboard.h and use it. Is there any way to force Arduino to use your library?
/home/user/Documents/ducky_interpreter-master/ducky_interpreter/ducky_interpreter.ino: In function 'int process_commad(char*)':
ducky_interpreter:349: error: 'KEY_PRINTSCREEN' was not declared in this scope
sendkey(KEY_PRINTSCREEN,0);
Multiple files found for "Keyboard.h"
Usado: /home/user/Downloads/arduino-1.8.5/libraries/Keyboard
No usado: /home/user/Arduino/libraries/arduino_keyboardlib-master
^
ducky_interpreter:354: error: 'KEY_MENU' was not declared in this scope
sendkey(KEY_MENU,0);
^
exit status 1
'KEY_PRINTSCREEN' was not declared in this scope
Thanks
When two libraries are found that contain a file matching the #include
directive, the Arduino IDE gives preference to the one with a folder name matching the file name. So for #include <Keyboard.h>
/home/user/Downloads/arduino-1.8.5/libraries/Keyboard is used over /home/user/Arduino/libraries/arduino_keyboardlib-master. I can see a couple solutions:
- Rename the file Keyboard.h to something unique.
- Add a dummy .h file (use_arduino_keyboardlib.h for example). As long as the
#include
directive for that file comes before the one for Keyboard.h, this library's Keyword.h will now be used:
#include <use_arduino_keyboardlib.h>
#include <Keyboard.h>
- As an enhancement on the previous, rewrite the library so the user can set the language by simply
#include
ing the appropriate header file before Keyboard.h instead of having to edit the library:
#include <it_it.h>
#include <Keyboard.h>