wgois / OIS

Official OIS repository. Object oriented Input System
https://wgois.github.io/OIS/
zlib License
254 stars 87 forks source link

improve keyboard #14

Closed rpaciorek closed 6 years ago

rpaciorek commented 8 years ago
  1. integrated pavlos256 'Improve LinuxKeyboard' (pull request #1) with current master
  2. support NumLock and CapsLock as modifiers, with correct initial state (currently only for LinuxKeyboard)
  3. improve KeyEvent to provide modifiers state and raw key code (need test for non Linux platform)
akien-mga commented 8 years ago

+1

akien-mga commented 8 years ago

Builds fine on Linux, I'm currently trying this PR + the master branch to see if it fixes issues I'm having with OIS 1.3.

RebelliousX commented 8 years ago

Just a question, does linux port support non buffered mode? That is using capture() then read status without events! Or are events implemented internally and I dont have to worry about them ss long as I have a pointer to Display?

Ybalrid commented 6 years ago

There are a number of problems with how the linux keyboard code is put together. The Xlib isn't really helping the situation :wink; I will create a specific project within this repository to see what we can do about. I'm keeping the PR opened for the sake of discussion.

Ybalrid commented 6 years ago

@RebelliousX you can indeed call capture(), then use "isKeyDown()" to get the current status of a key on Linux

Ybalrid commented 6 years ago

@rpaciorek Hi, if you are still around, why do you want to expose ray key "numbers" exactly? The goal of the library is to be explicitely cross platform.

Otherwise, I will look into adding the capslock and numlock key states as "modifiers" for all OSes, this seems an useful feature.

Will close this PR for now, and create an issue for the caps/numlock state as modifiers. If you want to convince me about the usefulness of "raw key number", you can still comment here ;-)

rpaciorek commented 6 years ago

Hi,

I don't remember motivation for adding "raw key number" (2 years is a lot of time ...). Especially that KeySym is not very "raw". I don't use it in my project using OIS, too.

I think the main goal was to add capslock and numlock as modifier and sending modifier status in event (to ensure keycode+modifier consistency). This is used in my project ;-)

Ybalrid commented 6 years ago

Okay.

The modifier thing will be integrated into OIS soon. We will keep track of that in Issue #34 ;-)