Comments (5)
Very good investigative work!
Spawning just one more grep process, the workaround could be as easy as:
grep -E 'Name|Handlers' /proc/bus/input/devices | grep -EA1 '[Kk]eyboard' |
grep -Eo 'event[0-9]+'
However, I would be very interested in your solution. :)
Original comment by [email protected]
on 15 Aug 2010 at 6:20
- Changed title: eventX different after USB keyboard is reconnected
- Changed state: Accepted
- Added labels: ****
- Removed labels: ****
from logkeys.
Disregard that last part.
I am more than interested. :D
Original comment by [email protected]
on 15 Aug 2010 at 6:23
- Added labels: ****
- Removed labels: ****
from logkeys.
Hello!
The attached file contains the code for a new device detection routine, which I
just finished writing.
Here is how it works:
- opens the file /proc/bus/input/devices
- scans for rows that begin with 'N' (name rows)
- checks if the name row contains text that indicates it's a keyboard (contains
"keyboard", "kbd", "hid", etc.)
- then scans for rows that begin with 'H' (handler rows)
- extracts the event number from the handler row
It has some features to try to make it robust. For example, if a keyboard
device is found but there is no handler row, then the code just continues
looking for the next keyboard device.
Also the code should be easy to modify to locate all keyboard devices (e.g.
return a std::vector<std::string> containing all input devices found). Right
now it stops when it finds the first one.
Finally, please note that I have only spent about 30 minutes testing this
routine. It seems to work properly on my machine, but bugs may turn up. :-)
Best regards,
Markus.
Original comment by [email protected]
on 15 Aug 2010 at 6:47
- Added labels: ****
- Removed labels: ****
Attachments:
from logkeys.
Oops :-) I just noticed that my determine_input_device() function is missing
the following line at the very end:
return std::string();
If no keyboard devices are found, and a return statement is not there, then we
will get undefined behaviour.
Regards,
Markus.
Original comment by [email protected]
on 15 Aug 2010 at 6:52
- Added labels: ****
- Removed labels: ****
from logkeys.
Device detection now parses 'Handlers' line and results in a vector since r74.
Original comment by [email protected]
on 19 Aug 2010 at 5:58
- Changed state: Fixed
- Added labels: ****
- Removed labels: ****
from logkeys.
Related Issues (20)
- Empty log with Ubuntu 13.04 HOT 18
- error when make
- Make file error with Kernel 2.6.9-55.EL
- keylog over rdp
- Empty log file with the correct event ID
- What means <#+3><#+10> etc.. ? HOT 3
- logkeys doesn`t capture from virtual keyboard HOT 1
- Store data to database
- Not Working With Logitech Keyboard and Unifying Receiver
- a way to determine keyboard device HOT 1
- Junk characters on Fedora 20 (x86_64) HOT 4
- French (canadian) keymap HOT 1
- Couldn't determine keyboard device. :/
- de_CH.map
- "you need en_US.UTF-8 availabe"
- Polish keymap
- Simple encryption for LogKeys (patch attached) HOT 1
- logkeys: LC_CTYPE locale must be of UTF-8 type
- Couldn't determine keyboard device
- Postponed letters HOT 1
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 logkeys.