12

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 Keyboard Mouse library. Since many years, there is a library called "V-USB" that requires some extra hardware and makes it possible for a ATmega328p ...


6

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: Keyboard.press(KEY_LEFT_GUI); Keyboard.press('e'); Keyboard.releaseAll(); This is equivalent to shortcut keys Win + E. The modifier GUI is what stands in for ...


6

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, USB_CONFIG_BUS_POWERED | USB_CONFIG_REMOTE_WAKEUP, USB_CONFIG_POWER_MA(500) } Just change the 500 to something smaller (it has to be an even number). However ...


5

The Arduino assumes a US keyboard layout. The thing with keyboards is they don't actually send the letters or symbols that are printed on the keys. Instead the send a scan code that defines where on the keyboard the key is. It is then up to the computer to convert those scan codes into actual letters and symbols, and that is performed by the keyboard ...


5

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 behaviour depending on how it's wired. A simple USB to PS/2 adaptor is merely a USB socket and PS/2 plug wired together in a certain way: So that's: 5V to 5V D- ...


4

You can't just "print" a key like that. You use print for sending text. When you use println it sends an enter key along with your text, so you can do : Keyboard.println("ls -al"); and it will send the text ls -al and press enter for you. If you want to do it in the 'raw' way you will need to press and then release the key: Keyboard.press(KEY_ENTER); ...


4

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 wireless transceivers that provide USB HID interfaces. and neither do Xbox or foldable keyboards. Too modern, and of course XBox has never needed PS/2 ...


4

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?


3

Looking at the list of the HID keyboard codes (page 53), the keys you are looking for have a code of E3 (Keyboard Left GUI) or E7 (Keyboard Right GUI). Unluckily the Keyboard::press function (you can see it here) does not accept a so high value, since you can only input numbers between 0 and 255 and, in order to send a raw value, you have to send its value ...


3

You have to do some tweaks to the usbkeyboard libraries that comes with the IDE. For a video tutorial, take a look at this: Arduino Leonardo as a multimedia keyboard Which uses the information from this site, if you prefer text only: Arduino Leonardo multimedia keys The Leonardo and ProMicro both use the ATMega32u4 and should both work with theses ...


3

Not without extra software on your computer side. However if you use Arduino Micro, you can emulate keyboard and/or mouse directly.


3

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 are not concerned about USB Hosts here. USB Devices only need to know about their own functions / features. If they are a serial port device, like the FTDI chip ...


3

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). Arduino already has a library to handle PS2 keyboards, so the implementation of it would be easy. For reference (and example program) playground.arduino.cc/Main/...


3

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 computer over serial, such as the Arduino Nano, to send data to a Python program which can then turn the input from the Arduino into keyboard presses, etc. ...


3

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 Keyboard.h library, this post states: Keyboard.h (and Mouse.h) only works on devices that use the ATmega32u4 processor, like the Leonardo or Micro. See: https://...


3

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: ./hardware/arduino/avr/cores/arduino/USBCore.h Inside that file, at around line 269 (depending on the distribution) you should see these lines: #define D_CONFIG(...


3

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. Keyboards don't know what is printed on the keycaps. All they understand is where the buttons are physically located. The same with the Arduino. It's sending ...


3

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 section E.4 (page 67) E.4 HID Descriptor (Keyboard) Part Offset/Size Description Sample (...


3

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. through STM32CubeMX). There you can select your chip and generate a template project. The program lets you easily configure the chip for "USB Device" role and HID (...


3

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 in order to have this application launched from a keyboard shortcut. Once you have done that, you can do the whole operation from a regular keyboard: Ctrl-C + ...


2

In the comments on SparkFun's product page for RN-42, gskelly indicates there is a flag in the v6.15 firmware that allows you to switch back and forth easily: Actually, since this includes the v6.15 firmware, you don’t need to re-flash the module to switch between HID and SPP. It can now be done using AT commands as follows: S~,6 // Enable HID on ...


2

I should be able to set and use the HID profile (from the default SPP) Unfortunately, your assumption is incorrect. From the same documentation you quoted, the previous sentence says: To use Roving Networks’ Bluetooth HID profile, you must use a special build of firmware, version 6.03 or later. Poorly phrased, this does mean that you need to have two ...


2

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 keys, the keyboard library doesn't have media keys functionality, so you need to use another one. This one worked for me: https://github.com/NicoHood/HID After you ...


2

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 code is 4 (constant kHID_ReportID_ConsumerControl), where the "report ID" code for keyboard and mouse are 2 and 1, respectively): static HIDSubDescriptor ...


2

So it might depend on how you implement it. With an Arduino Uno, your options for creating an HID device are limited to either reprogramming the 16u2 (which will require an ISP) or using a software USB implementation (like V-USB). If you go with the first method I'm pretty sure that will work as it will be a native USB connection. As for the second method, I'...


2

Let me try to help. This isn't a definitive "answer" but I need to post screenshots etc., so I am making it an answer. I tried your code with my Arduino Micro. I believe it is the same as the Leonardo except for a byte difference in the bootloader identification (for the USB device). First the good bad news. It worked under Windows 7. And let me tell you ...


2

First off, consider trying '\032' or '\x1A' for the ctrl-z. (See, eg, How to send ctrl+z in C on stackoverflow.) To send a ctrl-z, use something like: Keyboard.press(ctrlKey); Keyboard.press('z'); delay(100); Keyboard.releaseAll(); For more examples of using modifier keys, see the KeyboardPress page at arduino.cc, and the example program KeyboardLogout....


2

Could you just untick the "Use all F1, F2, …" in System Preferences -> Keyboard? Just wondering if that would be an option and if doing so would create the desired outcome.


2

Because the computer doesn't have a full OS at POST time any USB keyboards attached to the system have to operate in a special "Boot Keyboard" mode. Keyboards that implement the USB Boot Keyboard profile specified in the USB Device Class Definition for Human Interface Devices (HID) v1.11 and are explicitly configured to use the boot protocol will ...


2

Yes, it is perfectly possible. You ideally need an Arduino with a direct USB interface, such as the Leonardo. Then you can just access the Keyboard object to send the keystrokes to the PC. How your receive the data through Ethernet is entirely up to you. A simple TCP interface may be easiest - open the connection with whatever telnet-like client and ...


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