Comments (2)
what's worse is that the keycodes are highly dependent on the actual windowing backend.
here's a test with a german keyboard layout:
windowing backend | key combination | normal printout | gemkeyboard |
---|---|---|---|
glfw3 | A | a |
65 |
glfw3 | Shift_L+A | A |
340 65 |
glfw3 | Ö | ö |
59 |
glfw3 | Shift_R+Ö | Ö |
344 59 |
glut | A | a |
97 |
glut | Shift_L+A | A |
112 65 |
glut | Ö | ö |
246 |
glut | Shift_R+Ö | Ö |
113 214 |
glx | A | a |
38 |
glx | Shift_L+A | A |
50 38 |
glx | Ö | ö |
47 |
glx | Shift_R+Ö | Ö |
62 47 |
sdl | A | a |
38 |
sdl | Shift_L+A | A |
50 38 |
sdl | Ö | ö |
47 |
sdl | Shift_R+Ö | Ö |
62 47 |
sdl2 | A | a |
4 |
sdl2 | Shift_L+A | A |
225 4 |
sdl2 | Ö | ö |
51 |
sdl2 | Shift_R+Ö | Ö |
229 51 |
as you can see
- some backends will include capitalisation (
glut
), while others will not (glfw3
,glx
, sdl,
sdl2`) - some backends will use unicode points (
glut
at least for the printable characters, but notably not for Shift), others will almost use ASCII (glfw3
where it works for A but not for Ö), some will use XKeyCodes (glx
,sdl
) and some will use their own (sdl2
)
traditionally i've always been torn between exposing low-level functionality and normalizing the output so it is consistent across all windowing backends and platforms.
in practice, normalizing the output is a task that i have no hope of implementing.
the important takeaway is, that you should not consider the output of [gemkeyboard]
to be an ASCII value (or unicode point).
it's a number that represents a given key, not a letter.
from gem.
see also #15
from gem.
Related Issues (20)
- 'film' plugin does not load HOT 2
- Force rendering on gemhead not working HOT 3
- YUV420p->RGBA conversion is broken HOT 11
- [pix_buffer_filmopen] argument issues
- [pix_film_buffer] as [pix_film] alternative HOT 1
- [pix_buffer_filmopen] show same frame
- [pix_film] don't detect last frame
- [model] crash after windows re-creation HOT 1
- pix_offset doesn't wrap values as help says HOT 4
- postrender is executed a bit early, when associated with triggers HOT 9
- multisample framebuffer
- compute shader
- gemwin no longer accept argument for the X server to use HOT 6
- FSAA message did not work with gemglxwindow HOT 3
- Recent MacOS compile problems with Objective C sources HOT 11
- [GEM:videoNDI] [GEM:recordNDI] - libndi.4.dylib HOT 5
- pix_video no texture with virtual camera stream HOT 5
- texture coordinate are not set for line and point rendering for sphere and sphere3d primitives HOT 5
- Sphere rendering issue HOT 3
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 gem.