Comments (3)
I am having trouble understanding what you mean as you are using conflicting terms.
Repetitions of make codes (when key is pressed) is standard because this is the Typematic repeat performed by the keyboard, you can set the library to ignore repeats on SOME keys like CTRL, SHIFT, CAPS LOCK, ALT, SCROLL LOCK, NUM LOCK, if that is what YOU wish
The bottom 8 bits is always equivalent to ASCII upper case for A to Z, it is the upper 8 bits that determine what the status of make/break and other states like simultaneous keys Shift, Ctrl, Alt or GUI are pressed at same. Remembering CAPS is done by the CAPS LOCK key not any other key. Once pressed the CAPS LOCK LED is lit, until next time Caps Lock is pressed.
When you say "LCTRL" I assume you mean Left Control (CTRL) key which is a DIFFERENT function.
See folder in your installed library called "extra" for the documentation
There is a bit in the returned code that says if this is a Make or Break code, the following constants tell you different things
Constant | Description | |
---|---|---|
PS2_BREAK | This is a key break event (key release) | |
PS2_SHIFT | One of the SHIFT keys is STILL pressed at same time | |
PS2_CTRL | One of the CTRL keys is STILL pressed at same time | |
PS2_ALT | The (left) ALT key is STILL pressed at same time | |
PS2_ALT_GR | The (right) ALT or ALT-GR key is STILL pressed at same time | |
PS2_GUI | One of the GUI keys is STILL pressed at same time | |
PS2_CAPS | CAPS LOCK mode is on | |
PS2_FUNCTION | Keycode is a NON-displayable code function code |
To capture release events you MUST remember that the returned value form the library is an unsigned 16 bit int (uint16_t), to check for release code you need to AND the value with PS2_BREAK to see if this is a release event.
Key code values for BOTTOM 8 bits on functions like Shift are
PS2_KEY_NUM
PS2_KEY_SCROLL
PS2_KEY_CAPS
PS2_KEY_PRTSCR
PS2_KEY_PAUSE
PS2_KEY_L_SHIFT
PS2_KEY_R_SHIFT
PS2_KEY_L_CTRL
PS2_KEY_R_CTRL
PS2_KEY_L_ALT
PS2_KEY_R_ALT
PS2_KEY_L_GUI (Sometimes called windows key)
PS2_KEY_R_GUI (Sometimes called windows key)
PS2_KEY_MENU
Your description of problem suggests either misunderstanding of keyboard operations or not handling the values returned from the library correctly.
from ps2keyadvanced.
Yes, all that is right. Therefore there is a difference from the original behavior (if I connect keyboard directly to the computer).
Let's talk about computer games. You can map your CAPSLOCK key to Sit
for example. And why you hold it - you sit. You release it - you stand up. With the current implementation of the library - I can't get the same behavior because there is simply no event when the CAPSLOCK key is released. Only when pressed.
I would like to find a way to catch an event when CAPSLOCK is released OR change the behavior of the CAPSLOCK key to act as LEFT CTRL (with press/release events of course)
from ps2keyadvanced.
Can I suggest you should probably have either used the simpler RAW library https://github.com/techpaul/PS2KeyRaw or
you are welcome to fork a branch to change operation.
Vast majority os users are looking for ways to remove confusion on decoding every event and get filtered data in easier to understand data form to their application or add internationalisation.
from ps2keyadvanced.
Related Issues (20)
- Analog Input, is it possible? HOT 2
- Support for STM8S mcu (SDUINO) HOT 9
- Toggle typematic on/off entirely? HOT 2
- Acknowledging additional startup PS/2->Host messages HOT 4
- CODE AA error HOT 6
- Host-to-Device: Initial Clock low too short HOT 3
- increase buffer ?? HOT 3
- ESP32 garbage values HOT 9
- Arduino Nano Every ( MegaAVR board) Serial HOT 1
- My board does not work with this library
- ` and ~ keys and Keyboard . does not work HOT 1
- Send own bytes to keyboard HOT 3
- Pause key gives wrong code. setLock(.) doesn't work in setup() HOT 19
- 2 keyboards in 1 board HOT 3
- After pressing the NUMLOCK key, there is no response when any key is pressed. HOT 17
- weird mapping in some cases and no shift
- Missing release `V1.0.10`? HOT 2
- Keyboard almost working
- Parity in argument bytes sent from host
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ps2keyadvanced.