PS2Keyboard and CTRL

andromeda

Well-known member
Hi,
I use PS2Keyboard, it work fine, but i need to use CTRL+key,

example, CTRL+C, CTR+W etc,
how can i do this ?

the same with just PFx key, because it retrun 0
HOME and END return 0 too.

Thanks for your help.
 
You use the PS2 Keyboard for what?

Is this plugged into USBHost? Or are you trying to use a Teensy to emulate this?

Sketch? Hookup?
 
With PS2KeyAdvanced it work.

i use it with esp32 on board uterm2-s (ESP32).
it has ps2 connector on 32,33.
Thanks.
 
Yes, but that's because I'm using this library, that's why I wrote on this forum. Most of the functions are resolved except for NumLock. I've seen many users who have this locking problem, even though I'm using the UTERM2-s (ESP32) board which is 5v with a real ps/2 connector and works well with fabgl and other emulators that use the keyboard with their own code. The problem definitely comes from the library, I think.
 
The operation I suppose, as it is the same for most microcontrollers, but maybe it is optimized for the Teensy.
This library works very well; I won't use the keypad for the numeric keypad, which isn't a problem for what I want to do.
 
Apparently, the PS2KeyAdvanced library is the same one used for Teensy microcontrollers.
Would this library work on the Teensy 4.1 if I invest in this microcontroller? I seem to recall seeing in the documentation that it's limited to Teensy version 3.6.
Should I add two 4.7kΩ resistors to the CLK and DATA pins on the PS/2 connector connected to the Teensy?
Unless I use a 5V Teensy instead of a 3.3V one,
has anyone already tested this complete library, including Num Lock, etc., on a Teensy?
 
example, CTRL+C, CTR+W etc,
how can i do this ?
Probably in the same way that Shift keys are detected in the code:
They detect the 0x12 key as the left shift, for press and release. And then they use the knowledge that the Shift is pressed or not pressed.
To decide which of the tables to use.

In some other code, like Teensy USBHost code for keyboards, they maintain a set of modifier keys, which is probably more complete
than this. If I were hacking this, I would probably add a state bit for CTRL (0x14 I think), that gets set the state or clear it.
And then in the code and then add code to detect it in the area like:
Code:
} else if (state & (SHIFT_L | SHIFT_R)) {
And add section for CTRL and then convert the keys like A pressed CTRL state set then CTRL-A is returns 0x1...
 
Back
Top