14
votes
Arduino nano as HID Keyboard
Get yourself a Arduino Leonardo, Micro or Pro Micro (or Due, Zero, M0). Those can emulate a keyboard.
Start with reading the Arduino Keyboard Mouse reference.
The Arduino Nano can not use the Arduino ...
6
votes
Arduino Leonardo as keyboard for an iPad
If indeed the descriptor is the problem then yes you can change it.
In the core file USBCore.h is the line:
#define D_CONFIG(_totalLength,_interfaces) \
{ 9, 2, _totalLength,_interfaces, 1, 0, ...
6
votes
Press the Windows key using "keyboard.press();"
They Keyboard.press() command accept modifiers per the documentation. You may need to do multiple press() commands before releasing.
For example, if you want to launch File Explorer you could use:
...
5
votes
How to convert USB to PS/2?
Many USB keyboards (certainly older ones, though almost certainly not wireless ones) are also PS/2 keyboards. The wiring of the cable is all that differs, and the chip in the keyboard changes its ...
4
votes
How to add extra USB port to Arduino Nano?
USB is deceptively simple. The underlying protocol is very complex. So a complete answer to your question requires some USB background.
USB is divided into 2 types. USB Hosts and USB Devices. We ...
4
votes
Accepted
Typing into ESP8266 with a USB keyboard
My 2002-era Mac keyboard doesn't work,
That doesn't surprise me - modern Macs have never needed PS/2 support.
none of my 5 wireless keyboards work,
That's because they're not keyboards, they're ...
4
votes
Accepted
Keyboard.h not found
If you have Arduino/Genuino Uno selected as your board in the Tools ► Board ► menu, then you get the error. If you select Arduino Leonardo it compiles correctly.
From Can't seem to be able use ...
4
votes
ESP8266: #include <Keyboard.h> causes fatal error: HID.h: No such file or directory
The Keyboard library is for Arduino ATMega32U4 based Arduinos (and other similar ones with USB) only. The ESP8266 does not have USB, so how can it possibly use the Keyboard library?
4
votes
Accepted
How to cut down size of imported DigiKeyboard library
With input from @EdgarBonet, I looked into the functions used and it turned out that the String() function, I used once in my code, takes up about 3kB of space in the compiled program.
I ended up ...
4
votes
Accepted
Mouse.move: how do I move the mouse to the center of a screen?
There are two ways of working with HID mice - absolute and relative. The Arduino Mouse library only works in relative mode, but you want absolute.
There's another library https://github.com/NicoHood/...
3
votes
Arduino nano as HID Keyboard
The solution to get a board that has built in USB support is not preferred for someone who just wants to use the boards they already have. It is possible to use a board that can communicate with your ...
3
votes
Accepted
Grab keys from an ordinary USB keyboard
As suggested in the comments, you have two options:
As suggested by Majenko, you can use the Arduino USB Host Shield:
Alternatively you could use a PS2 keyboard instead (as suggested by Gerben). ...
3
votes
Send Keyboard Media Keys with Keyboard Library
It is indeed possible and also without the requirement to modify the Arduino environment itself. Just register an HID descriptor for the "report ID" for "Consumer Control" (the ...
3
votes
Accepted
Arduino Micro draws too much power from iPhone. How can I change that?
The power consumption is part of the exchange with the PC when it is plugged in. You can change that. Find the file USBCore.h in your Arduino install directory. In my case (under Linux) it was:
./...
3
votes
Emit region-neutral keyboard signals
No. There is no such facility.
If you take a German keyboard and plug it into a US configured computer the key layout will be wrong. You have to tell the computer that you're using a German keyboard.
...
3
votes
Emit region-neutral keyboard signals
Download Device Class Definition for Human Interface Devices (HID)
https://www.usb.org/sites/default/files/documents/hid1_11.pdf
See section 6.2.1 HID Descriptor
bCountryCode 0x09 German
also see ...
3
votes
Accepted
STM32 as keyboard
The STM32F105xx series is not yet supported by either Arduino core (STM32 core or maple core) and neither mbed-os.
The chip is still usable with the STM32 provided framework, the STM32HAL, (e.g. ...
3
votes
Accepted
Why can the Xbox360 not detect the Arduino Leonardo as keyboard?
Like Juraj and Majenko said. Arduino Keyboard library does emulate "Boot Keyboard".
I use NicoHood HID library and now it works.
3
votes
Using Keyboard library for ISO-UK layout
The USB keyboard protocol has no concept of characters. It doesn't know and doesn't care what character a key represents. Instead each code represents the location of the key on the keyboard, and it's ...
3
votes
Accepted
Save highlighted text as int variable
You have to write an application for your PC that
reads a number from the clipboard
adds some constant
puts the result back in the clipboard
quits
Then you have to configure you desktop environment ...
3
votes
Accepted
Can't type backslash (\) with Keyboard library
You have to keep in mind that the Arduino doesn't send characters to the
computer. Instead, it simulates key presses, and the computer has to
translate those into characters, according to some ...
3
votes
Will an Arduino Nano work instead of Teensy 3.2?
No, you can't use Adruino Nano, because in this project the Teensy board has been used as an USB Keayboard and Nano has separate communication chip (FTDI or CH430) that can't emulate USB keyboard.
...
2
votes
Send Keyboard Media Keys with Keyboard Library
If you are getting zeros, the most probably cause is it's the library for the IR. Reinstall or update the library. Sometimes you have to reinstall more than one time. That should work.
About media ...
2
votes
How to reprogram Arduino if USB port is already in use?
https://digistump.com/wiki/digispark/tutorials/connectingpro
It is suggested that in order to upload using the Arduino IDE you must:
Add the repository http://digistump.com/package_digistump_index....
2
votes
Digispark / DigiKeyboard change keyboard layout
You can edit the file scancode-ascii-table.h in your DigiKeyboard library.
It basically states which ASCII code corresponds to which keyboard scancode.
So if you try to print the ':' character but ...
2
votes
65 hall effect sensors as switches to be used as a keyboard with a teensy
[Completely rewritten answer]
That seems fun. But why 65 keys ? with 64 keys it is easier.
You have to test the sensitivity of the hall switches with the magnets to know how far apart the keys must ...
2
votes
Grab keys from an ordinary USB keyboard
I am able to use this library: https://github.com/techpaul/PS2KeyAdvanced and USB's data +/- connected to pins 2+3 of an arduino to read keys on standard keyboards.
keyboard.begin( 3, 2); // D3= data+...
2
votes
Accepted
Arduino as a real device to computer
As per my understanding, the mouse has a microcontroller and a TTL serial converter which is programmed a certain way that enable computer's default mouse driver to understand the instructions coming ...
2
votes
Arduino/ESP8266 to put PC to sleep and wake it up
The hardware interface would be the easiest like others were saying.
Here is a project someone else shared that does that.
https://www.hackster.io/zvonko-bockaj/wemos-esp8266-remote-pc-switch-062c7a
...
2
votes
Accepted
NodeMCU capable of key injection?
No, you can't use a NodeMCU for this.
To emulate a USB keyboard you have to have a device with a main MCU on it which is directly connected to USB. The ESP8266 on the NodeMCU is not a USB-capable MCU,...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
keyboard × 128usb × 29
arduino-uno × 26
arduino-leonardo × 21
atmega32u4 × 10
arduino-nano × 9
serial × 8
programming × 7
bluetooth × 7
arduino-micro × 7
teensy × 7
arduino-mega × 5
button × 5
arduino-pro-micro × 5
digispark × 5
hid × 5
esp8266 × 4
library × 4
shields × 4
adafruit × 4
mouse × 4
arduino-ide × 3
c++ × 3
attiny × 3
windows × 3