Opened 13 years ago
Closed 13 years ago
#7963 closed enhancement (fixed)
get_keyboard_id in InterfaceDefs unimplmented
Reported by: | jscipione | Owned by: | siarzhuk |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Servers/input_server | Version: | R1/Development |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | All |
Description
The function get_keyboard_id() declared in InterfaceDefs.h always returns 0. It should return an id provided by the keyboard hardware. According to the BeBook for a 101 key keyboard (and perhaps others) it should return 0x83ab.
Attachments (2)
Change History (12)
by , 13 years ago
Attachment: | get_keyboard_id_1.diff added |
---|
comment:1 by , 13 years ago
patch: | 0 → 1 |
---|
by , 13 years ago
Attachment: | getkbid.cpp added |
---|
Small test program to check your keyboard id. Compile with gcc -lbe -o getkbid getkbid.cpp
and run from the command line.
comment:2 by , 13 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:3 by , 13 years ago
Any app using it ? It shouldn't be used anyway, it only accounts for 1 keyboard while we want to introduce multi-device support someday...
Is there any logic in those IDs appart the value ?
comment:5 by , 13 years ago
Hmm inserting stuff in the enum in InputServerDevice.h will break binary compatibility...
comment:6 by , 13 years ago
Btw, keyboard_id isn't really a "setting" per see, it is a hardware report, there is no reason one should be able to set it.
follow-up: 9 comment:7 by , 13 years ago
Did you actually try your patch ? It wouldn't even work because the fSettings field of the KeyboardDevice isn't copied back to input_server's own version, it's only used locally in the add-on.
comment:8 by , 13 years ago
Replying to mmu_man:
Btw, keyboard_id isn't really a "setting" per see, it is a hardware report, there is no reason one should be able to set it.
I only implemented it as a setting because I was grasping as straws. Setting the keyboard id should be done at Input Server init perhaps, then get_keyboard_id() should simply return the value.
For multi-device support we could overload get_keyboard_id() to take an index so get_keyboard_id(0) would get the first keyboard's ID, get_keyboard_id(1) would get the second keyboard, etc. We would need to keep the parameterless key_keyboard_id() function for backwards compatibility and have it call get_keyboard_id(0).
I was also thinking that it might be nice to extend get_keyboard_id() to get the USB ID of USB keyboards as well if you have one of those attached. But perhaps that is not very helpful without the USB Vendor ID as well.
comment:9 by , 13 years ago
Replying to mmu_man:
Did you actually try your patch ? It wouldn't even work because the fSettings field of the KeyboardDevice isn't copied back to input_server's own version, it's only used locally in the add-on.
I did try the patch, it didn't ever work. I was in way over my head so I attached the incomplete patch only as a help to someone much smarter to take it and run with it. I see that strategy has seemed to work. :)
comment:10 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Implemented differently in hrev43037. Thanks!
This patch represents my attempt to grab the keyboard id from the PS/2 driver. It is incomplete but can be a starting point to anyone interested in implementing this feature.