Contribute
Register

How to remap Fn+up/down to PageUp/PageDown ?

Status
Not open for further replies.
Joined
Apr 9, 2011
Messages
28
Motherboard
HP ProBook 450 G2
CPU
i5-5200U
Graphics
HD5500
Mobile Phone
  1. iOS
Hi!

I've found that key combination extremely useful for coding - it is default keyboard functions for Asus UX305CA that I've also hacked.
I belive there's many options, but I'd prefer DSDT hotpatch approach if available :D (I'm using hotpatch approach to DSDT)
Got hack Probook 450G2, 10.11.6, not using VoodooPS2, have some proficiency in patching DSDT, using ACPIDebug...
Where to start?
Should I install VoodooPS2 and provide custom ADB keymap remap table for this, finding specific codes with Debug version? Or rather instrument EC queries ?

Thanks for help!
 
Hi!

I've found that key combination extremely useful for coding - it is default keyboard functions for Asus UX305CA that I've also hacked.
I belive there's many options, but I'd prefer DSDT hotpatch approach if available :D (I'm using hotpatch approach to DSDT)
Got hack Probook 450G2, 10.11.6, not using VoodooPS2, have some proficiency in patching DSDT, using ACPIDebug...
Where to start?
Should I install VoodooPS2 and provide custom ADB keymap remap table for this, finding specific codes with Debug version? Or rather instrument EC queries ?

Thanks for help!

Most PC keyboards do not generate a separate code for Fn (there are rare exceptions such as my Lenovo u430).
The Fn key usually modifies existing keys instead of generating a standalone code.
Are you finding your Fn key generates its own separate scan code when pressed by itself?

Note: The two ProBooks here (4530s, 4540s) do not generate a standalone PS2 scan code for Fn.
 
Is there a way to check it on vanilla S/L/E ? But I doubt Fn key generates scancode - I didn't observe such behavior on apps...
Can I use Karabiner to do such remap? I've installed it but didn't find specific complex rule...
 
Is there a way to check it on vanilla S/L/E ? But I doubt Fn key generates scancode - I didn't observe such behavior on apps...
Can I use Karabiner to do such remap? I've installed it but didn't find specific complex rule...

It is very unlikely your Probook generates a PS2 code for Fn by itself.

Detecting whether it does or not requires building a custom VoodooPS2Controller.kext.

In VoodooPS2Keyboard.cpp, you find this commented code:
Code:
PS2InterruptResult ApplePS2Keyboard::interruptOccurred(UInt8 data)   // PS2InterruptAction
{
    ////IOLog("ps2interrupt: scanCode = %02x\n", data);
    ////uint64_t time;
    ////clock_get_uptime(&time);
    ////IOLog("ps2interrupt(%lld): scanCode = %02x\n", time, data);
...
}

If you uncomment those lines, you will get output in the kernel logs of each PS2 scan code that comes from the keyboard port (this code is the keyboard interrupt handler).
 
Thanks Rehabman! Built modified kext. I will check rest tommorow!
 
Ok, so here's the gathered intel.
Fn indeed doesn't generate scancode - modified VoodooPS2Controller.kext (I had to go back to XCode5.1.1 to compile it (macosx10.8 SDK) ;) didn't reveal any surprises.
What I know from there are scancodes for :

keydown : e050=7d
keyup : e048=7e
pageup : e049=74
pagedn : e051=79

I patched DSDT for ACPIDebug (injected RMDT device and instrumented EC queries), although ACPIDebug (not installed in /L/E nor /S/L/E - loaded via sudo kextload with proper permissions/owners [0:0]) doesn't show any debug info in system.log besides "ACPIDebug: Version 0.1.4 starting on OS X Darwin 15.6."
I got only one message (ACPIDebug: "EC _Q22 enter") ever since...

Attached some files, I know I have some mess in ioReg, but anyhow it works somehow... ;)

Code:
gobomac:Release gobo$ kextstat | grep ACPI
   11   28 0xffffff7f80b83000 0x9000     0x9000     com.apple.iokit.IOACPIFamily (1.4) 5D7574C3-8E90-3873-BAEB-D979FC215A7D <7 6 4 3>
   13    2 0xffffff7f82e63000 0x66000    0x66000    com.apple.driver.AppleACPIPlatform (4.0) A29C7512-D3A8-3AED-9721-3A5FF1A32EB2 <12 11 7 6 5 4 3 1>
   32    0 0xffffff7f82ec9000 0x7000     0x7000     com.apple.driver.AppleACPIEC (4.0) 87E6B264-9FE7-354F-A83B-2AF966681A50 <31 13 11 5 4 3>
   34    0 0xffffff7f82ed3000 0x4000     0x4000     com.apple.driver.AppleACPIButtons (4.0) 456C28F7-4F2B-3F00-97C9-BF6023DADD7C <33 15 13 11 7 6 5 4 3 1>
   38    0 0xffffff7f81338000 0x2000     0x2000     com.rehabman.driver.ACPIPoller (0.8.1) 4150AC89-DEC4-37F1-9CA3-04184F3B5AA1 <11 4 3>
  147    0 0xffffff7f82f6c000 0x4000     0x4000     com.rehabman.driver.ACPIDebug (0.1.4) 9A0916D1-E9C6-3570-90E9-4DDC4BB19FB7 <11 4 3>

EDIT: I've also checked by patchmatic for existence of RMDT signature in DSDT.aml.

EDIT2: After mind-parsing those EC queries in my DSDT I really doubt that Fn keys goes through it somewhere, also... (I'm probably saying that wheel is circular here, but have no exp with this...)
 

Attachments

  • gobomac.ioreg
    2.2 MB · Views: 172
  • DSDT.dsl
    1 MB · Views: 219
Last edited:
I had to go back to XCode5.1.1 to compile it (macosx10.8 SDK) ;)

I'm using Xcode9 with the various SDKs added to it.

Fn indeed doesn't generate scancode

Then it is not possible to do what you want to do.

What I know from there are scancodes for :

keydown : e050=7d
keyup : e048=7e
pageup : e049=74
pagedn : e051=79

These are standard arrow/page keys.
 
Yup, unfortunately. Lets close this topic as unsolvable...
 
Status
Not open for further replies.
Back
Top