Le 03/11/2014 à 05h29, Charles Devereaux a écrit :
Hello
On Sun, Nov 2, 2014 at 8:26 AM, Garreau, Alexandre galex-713@galex-713.eu wrote:
Where do come from the numbers used in the two scripts you showed? I suppose there’s a code for each XFree86 keysym, right?
IIRC, it's just a linear function of the keysym: there is a difference by about 80
Ok… any example anywhere? like a wiki page?
Talking about /sys/devices/platform/thinkpad_acpi: do you have the file “hotkey_tablet_mode”? I need it to detect when the screen is turned in tablet mode so that I can automatically rotate the screen. Do it need to be implemented in coreboot too?
No, this is due to missing DSDT entries in coreboot that thinkpad-acpi uses:
2058 static int hotkey_get_tablet_mode(int *status) 2059 { 2060 int s; 2061 2062 if (!acpi_evalf(hkey_handle, &s, "MHKG", "d")) 2063 return -EIO; 2064 2065 *status = ((s & TP_HOTKEY_TABLET_MASK) != 0); 2066 return 0; 2067 }
However, with the latest patch from φcoder, you should have the ACPI events directly
Ok, so just upgrade should fix it right?
Fn+F6 and F8 show up in cat /dev/input/event4,
Not here.
More problematic, Fn+F10, Fn+insert, Fn+delete are dead as can be - regardless of the /sys/devices/platform/thinkpad_acpi/hotkey_mask
Yeah, that’s the problem.
According to http://www.thinkwiki.org/wiki/How_to_get_special_keys_to_work#Triggering_key_events:
By disassembling and editing the DSDT, more events can be added. HKEY events are triggered by calls to the MKHQ function, e.g. _SB.PCI0.LPC.EC.HKEY.MHKQ(0×1007) will trigger "ibm/hotkey HKEY 00000080 00001007". Most of these can be found in _Qxx methods within the DSDT, which are executed on embedded controller events, e.g. _Q10 is triggered by pressing Fn-F7. You can add a call to MKHQ into an existing _Qxx method to get it recognized by thinkpad-acpi as well as creating new _Qxx methods, which if you're lucky will correspond to an EC event that IBM never used (e.g. A 770 will send Fn-Home/End/PgUp/PgDn to thinkpad-acpi if hacked in this fashion). For example, this is a modified block of DSDT for a G40 http://www.wormnet.eu/ibm-g40/morebuttons.dsl.
My best idea at the moment is that the EC gives different Q codes than those in the DSDT for the keys that do not generate ACPI events.
What’s a DSDT? I’m not sure of what’s HKEY, and I’m sure I don’t understand what’s MKHQ, _Qxx, Q code, EC and G40.
Yet in src/ec/lenovo/h8/acpi/ec.asl, I do see Fn+10, Fn+Insert, Fn+Delete and also Fn+Backspace, ie everything has been added, but thinkpad-acpi shows nothing in /dev/input/event4 Am I missing something?
Even Fn+Insert and Delete? :D /me’s wondering if maybe the trick Fn+<numpad> would be possible with some hack…
PS: Do you have a PGP key?
I do, but for public communication (ex: mailing list) I don't use it.
Even for signature?
Hello
On Mon, Nov 3, 2014 at 4:58 AM, Garreau, Alexandre galex-713@galex-713.eu wrote:
Ok… any example anywhere? like a wiki page?
No, I was just speaking from memory. Try some increasing numbers and see what you get in xev.
Ok, so just upgrade should fix it right?
This is http://review.coreboot.org/6765, it depends on the version you use.
What’s a DSDT? I’m not sure of what’s HKEY, and I’m sure I don’t understand what’s MKHQ, _Qxx, Q code, EC and G40.
Basically, this means this stuff is handled within coreboot, and should use certain ways that thinkpad-acpi will recognize. I hoped other persons would be interested by the discrepancies we both noticed, but nope. Too bad. This means the bug (as there seem to be one) will not be fixed anytime soon.
Even Fn+Insert and Delete? :D /me’s wondering if maybe the trick Fn+<numpad> would be possible with some hack…
Fn+PrintSc, Fn+ScrLk, Fn+Pause all work for me in xev. I don't think they are handled as the others, so you won't be able to remap them (unless you say that keycode 107 is not Sys_Req but your key, etc - IMHO a bad idea)
PS: Do you have a PGP key?
I do, but for public communication (ex: mailing list) I don't use it.
Even for signature?
As nobody tried to impersonate me yet, no :-)