Programmable key outputs
Hello,
I am very new to hardware comp engineering (like ardiuno and stuff like that); however, i love to code in java (I can use cpp, but java is a strong preference). Is there any hardware keyboard output products I can buy and connect to via an api/library that simulates a low level keyboard button press?
< >
Näytetään 1-15 / 19 kommentista
I'm not sure I understand your aims or requirements.

The simplest, most ready-made thing you can buy is simply a QMK programmable keyboard. You checkout the source of QMK, write a keymap, which is a small C file that customizes how the keyboard works, compile and flash it to your keyboard. You can get such a keyboard from Keychron or something cheaper from AliExpress.

Or you can buy a single-board computer like an RPi Pico or Zero, and look for tutorials on programming it to work like a USB HID device.

You can also simulate a keyboard completely in software, but the way to do that is going to depend on the OS. Linux has uinput for that, Windows - no clue, but it's certainly possible as evidenced by the existence of software like Synergy.
_I_ lähetti viestin:
arduino can, fairly simple
https://docs.arduino.cc/tutorials/micro/keyboard-press/
When using the code provided by the website, will ardiuno micro connecct as a keyboard driver? How will windows display the micro board as? Also, are the ardino keyboard library method calls be considered at a low level/driver level?
Zygfryd lähetti viestin:
I'm not sure I understand your aims or requirements.

The simplest, most ready-made thing you can buy is simply a QMK programmable keyboard. You checkout the source of QMK, write a keymap, which is a small C file that customizes how the keyboard works, compile and flash it to your keyboard. You can get such a keyboard from Keychron or something cheaper from AliExpress.

Or you can buy a single-board computer like an RPi Pico or Zero, and look for tutorials on programming it to work like a USB HID device.

You can also simulate a keyboard completely in software, but the way to do that is going to depend on the OS. Linux has uinput for that, Windows - no clue, but it's certainly possible as evidenced by the existence of software like Synergy.
When you say flash it to my keyboard, what does that necessarily mean? Also, if I were to create something like keyboard presses through the QMK keyboard, would the keypress be through the hardware output? Or would it be through software? In other words, if I were to have a keyboard press call, will the button be associated with the physical keyboard hardware execution?
schizo lähetti viestin:
When you say flash it to my keyboard, what does that necessarily mean? Also, if I were to create something like keyboard presses through the QMK keyboard, would the keypress be through the hardware output? Or would it be through software? In other words, if I were to have a keyboard press call, will the button be associated with the physical keyboard hardware execution?
Flashing is the process of installing your customized firmware onto the keyboard. You do it once each time you modify your firmware's source code. It happens over USB and usually requires putting the keyboard into bootloader mode. (methods of doing that vary, it may be a key combo, holding down a key during connecting the cable, or shorting a set of pins on its mobo)

A QMK keyboard looks like any other USB keyboard, when you program it to send a keystroke, it'll look the same regardless of whether you triggered it by pressing one of its keys, from a timer function, or in response to receiving a command from the computer over eg. raw HID[docs.qmk.fm]. It sends the keystroke over its USB hardware connection to the computer.

And yes you can configure it to pretend to be of any manufacturer or model.

PS. Avoid buying a keyboard with an AVR chip inside, they have very little storage and it's hard to fit a lot of custom code on them. Keychron QMK boards have STM32 chips with ample flash. The V (non-Max) series boards are relatively cheap and wired only, so you don't have to bother with using their wireless fork of QMK instead of mainline.
Viimeisin muokkaaja on Zygfryd; 20.6.2024 klo 15.33
_I_ 20.6.2024 klo 15.35 
many programmable keyboards use a virtual keyboard through windows driver to run the mapped keys or macros and media controls

when using the arduino keyboard library is seen as another usb keyboard/mouse, can control most mobos in bios (a few will not as its not a common keyboard)
https://www.arduino.cc/reference/en/language/functions/usb/keyboard/
_I_ lähetti viestin:
many programmable keyboards use a virtual keyboard through windows driver to run the mapped keys or macros and media controls
Possibly, I don't use any keyboards that aren't running QMK or ZMK anymore. These programmable keyboards run code on their own hardware and send real hardware keystrokes, over the standard USB HID protocol. An OS-side driver/program is only needed to do things USB HID can't, like launching programs, or maybe inputting emoji.
Zygfryd lähetti viestin:
schizo lähetti viestin:
When you say flash it to my keyboard, what does that necessarily mean? Also, if I were to create something like keyboard presses through the QMK keyboard, would the keypress be through the hardware output? Or would it be through software? In other words, if I were to have a keyboard press call, will the button be associated with the physical keyboard hardware execution?
Flashing is the process of installing your customized firmware onto the keyboard. You do it once each time you modify your firmware's source code. It happens over USB and usually requires putting the keyboard into bootloader mode. (methods of doing that vary, it may be a key combo, holding down a key during connecting the cable, or shorting a set of pins on its mobo)

A QMK keyboard looks like any other USB keyboard, when you program it to send a keystroke, it'll look the same regardless of whether you triggered it by pressing one of its keys, from a timer function, or in response to receiving a command from the computer over eg. raw HID[docs.qmk.fm]. It sends the keystroke over its USB hardware connection to the computer.

And yes you can configure it to pretend to be of any manufacturer or model.

PS. Avoid buying a keyboard with an AVR chip inside, they have very little storage and it's hard to fit a lot of custom code on them. Keychron QMK boards have STM32 chips with ample flash.
This is pretty interesting, but to start, should I just buy a qmk keyboard? And with this keyboard, is there any way to use java code to call the qmk keyboard to press something like letter 'q'?

i.e. example of what i might try to do

public class Test{
public static void main(String[] args){
pressKeyboardStrokeThroughQMK(0x41); // a
}
}
_I_ lähetti viestin:
many programmable keyboards use a virtual keyboard through windows driver to run the mapped keys or macros and media controls

when using the arduino keyboard library is seen as another usb keyboard/mouse, can control most mobos in bios (a few will not as its not a common keyboard)
https://www.arduino.cc/reference/en/language/functions/usb/keyboard/
So, this would technically be considered as two keyboard inputs, assuming i plug in the arduino micro to my pc?
schizo lähetti viestin:
This is pretty interesting, but to start, should I just buy a qmk keyboard? And with this keyboard, is there any way to use java code to call the qmk keyboard to press something like letter 'q'?
Should you? I don't know, you'll need to judge your ability to write the required code yourself. According to the link I posted earlier, yes, you can write the program that sends commands to the keyboard in Java. However, you'll also need to write, in C, the part that receives the commands and sends keystrokes on the firmware side.
Zygfryd lähetti viestin:
schizo lähetti viestin:
This is pretty interesting, but to start, should I just buy a qmk keyboard? And with this keyboard, is there any way to use java code to call the qmk keyboard to press something like letter 'q'?
Should you? I don't know, you'll need to judge your ability to write the required code yourself. According to the link I posted earlier, yes, you can write the program that sends commands to the keyboard in Java. However, you'll also need to write, in C, the part that receives the commands and sends keystrokes on the firmware side.
I think i'm buying whaty you're selling, ill look into the GH/documentation abt this. To make sure I aint going into this blind, is there a way to check if I meet the keyboard specefications like if it is QMK combatiable or smth?

P.S. I have a red dragon k582 keyboard
schizo lähetti viestin:
I think i'm buying whaty you're selling, ill look into the GH/documentation abt this. To make sure I aint going into this blind, is there a way to check if I meet the keyboard specefications like if it is QMK combatiable or smth?

P.S. I have a red dragon k582 keyboard
Well I mentioned Keychron, because their Q (non-Pro non-Max) and V (non-Max) series keyboards already come with QMK and are supported by the official fork.

But you might be in luck, as K582 is listed as supported by a different QMK fork: https://sonixqmk.github.io/SonixDocs/compatible_kb/
Note that this is unofficial support, might not work 100% and you might brick your keyboard if you do something wrong. No idea how much storage they have either. Be sure to have a backup keyboard if you risk flashing SonixQMK to your Redragon.

PS. My current keyboard is a https://aliexpress.com/item/1005006262266874.html , the blue one with Skyloong Brown switches. It's also supported by official QMK, the switches have a great tactile feel (unlike Cherry MX Brown), and I love the shape of the keycaps.
Viimeisin muokkaaja on Zygfryd; 20.6.2024 klo 16.17
You could use a Raspberri pi and solder it to actual keys

Idk, I kind of inferred that you want to make a keyboard that will give you macro outputs to write code easier?

If you wanted to do that, you could create your own AI self correcting code, after some machine learning.
Zygfryd lähetti viestin:
schizo lähetti viestin:
I think i'm buying whaty you're selling, ill look into the GH/documentation abt this. To make sure I aint going into this blind, is there a way to check if I meet the keyboard specefications like if it is QMK combatiable or smth?

P.S. I have a red dragon k582 keyboard
Well I mentioned Keychron, because their Q (non-Pro non-Max) and V (non-Max) series keyboards already come with QMK and are supported by the official fork.

But you might be in luck, as K582 is listed as supported by a different QMK fork: https://sonixqmk.github.io/SonixDocs/compatible_kb/
Note that this is unofficial support, might not work 100% and you might brick your keyboard if you do something wrong. No idea how much storage they have either. Be sure to have a backup keyboard if you risk flashing SonixQMK to your Redragon.

PS. My current keyboard is a https://aliexpress.com/item/1005006262266874.html , the blue one with Skyloong Brown switches. It's also supported by official QMK, the switches have a great tactile feel (unlike Cherry MX Brown), and I love the shape of the keycaps.
I suppose I will buy one of the keyboards that already is compataible QMK to not risk bricking my keyboard ;-;

Many thanks
dc_ lähetti viestin:
You could use a Raspberri pi and solder it to actual keys

Idk, I kind of inferred that you want to make a keyboard that will give you macro outputs to write code easier?

If you wanted to do that, you could create your own AI self correcting code, after some machine learning.
i'm a bit curious how an AI implementation would play into that lol. but ye, that is sort of venturing into a different realm of what I might want to accomplish. Im lookin more towards hardware/coding practice
< >
Näytetään 1-15 / 19 kommentista
Sivua kohden: 1530 50

Lähetetty: 20.6.2024 klo 14.28
Viestejä: 19