Skip to main content
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 ...
Majenko's user avatar
  • 106k
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 ...
Greenonline's user avatar
  • 3,152
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 ...
Majenko's user avatar
  • 106k
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?
Majenko's user avatar
  • 106k
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 ...
emma.makes's user avatar
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/...
Majenko's user avatar
  • 106k
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 ...
jsotola's user avatar
  • 1,553
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. ...
Majenko's user avatar
  • 106k
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: ./...
Nick Gammon's user avatar
  • 38.9k
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 ...
nicholas's user avatar
  • 131
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 ...
Peter Mortensen's user avatar
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. ...
Maximilian Gerhardt's user avatar
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.
eolandro's user avatar
  • 141
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 ...
Majenko's user avatar
  • 106k
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 ...
Edgar Bonet's user avatar
  • 45.2k
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 ...
Edgar Bonet's user avatar
  • 45.2k
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. ...
KIIV's user avatar
  • 4,907
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 ...
Jesus Ulloa's user avatar
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 ...
techknowpro's user avatar
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,...
Majenko's user avatar
  • 106k
2 votes

Controlling keyboard LEDs with USB Host Shield

There does seem to be a method called SetReport in the USBHID class, which looks like it takes the same arguments, which I'm trying to use. The method arguments of the new SetReport() method aren't ...
Olivier Dagenais's user avatar
2 votes

Is Arduino Keyboard in Single User Mode Possible?

OS X requires a "Boot Interface" compatible HID profile for a keyboard to work in single user mode (it has only loaded very rudimentary drivers by that point). The Arduino doesn't provide that ...
Majenko's user avatar
  • 106k
2 votes

Arduino HID keyboard does not work

Keyboard.press() expects a character, but you are passing a character array. Also Keyboard.press() only presses but does not release the key. Keyboard.releaseAll() can be used to release all keys. I ...
user85471's user avatar
  • 851
2 votes
Accepted

Which kind of diodes I should use in buttons/keys matrix input? (Making gaming keyboard)

When I've used a keypad matrix I've wired it up like this: I used 1N4148 SMD diodes which I bought cheaply. I cut the traces on my cheap board that I had purchased from Jaycar and soldered them in ...
Nick Gammon's user avatar
  • 38.9k
2 votes

How can I make my Arduino Uno press Space on my laptop keyboard?

if you have some knowledge in Java or Python you can interface your Arduino board to PC, through Arduino's SerialPort. When Arduino sends a byte, for example, 0xAB, your Java or Python script sends a ...
simonecocco's user avatar
2 votes
Accepted

How can I make my Arduino Uno press Space on my laptop keyboard?

On Windows you can use a serial to keyboard redirector like this one It can start with windows, Im using it for a long time without any issues.
Dorian's user avatar
  • 369
2 votes

Holding buttons (keyboard)

The root problem is that you send each several ms new key event and on receiver each time you get this event, you call Keyboard.press and right away Keyboard.release. So, it behaves as several key ...
Ihor Drachuk's user avatar
2 votes
Accepted

Button and twist knob to send keystroke to PC

As a novice, I would like to create a small breadboard with 5 items on it. 3 toggle buttons, and two constant spin (ie. no stop at 360 degrees) knobs. Those knobs are called "Rotary Encoders&...
Majenko's user avatar
  • 106k
2 votes

Using Keyboard library for ISO-UK layout

For completeness I am posting this answer. You can produce a UK backslash keystroke event by using something like #define KEY_BSLASH 0xEC This was found rather more empirically than analytically so ...
RedGrittyBrick's user avatar
2 votes

Change character sequence

I usually recommend against using delay()s, but if this system will only ever have to do what you've described, using delay()s is the simplest way to implement it. I would suggest sending key-1, ...
JRobert's user avatar
  • 15.4k

Only top scored, non community-wiki answers of a minimum length are eligible