Help - Search - Members - Calendar
Full Version: Adding Fn Key Toggle Support For Laptops
Project OS X Forums > Snow Leopard Guides & Tutorials > DSDT Patching
prasys
Hey guys

over the past few days , i am trying hard to get a way our Fn keys on our laptops to be regonised by programs such as FunctionFlip , so that I can get it to work - thus making it easier for netbook and not to mention laptop users to use function keys without the need of pressing Fn + Fx key. Real macs do have this option but then for us hackies , OSX does not seem to acknowledge bout it

After digging about how buggy is PS2 driver ( we are converting PS2 to ADB) and i took a look at how appleadbkeyboard works (its found in ibooks and powerbook , aka pre macbook(pro) era). Since these devices used ADB and its somewhat like PS2. I thought there must be something special which showed these devices that its a laptop keyboard and not a desktop keyboard and voila , I managed to hit the jackpot and it did play some role.

So firstly , look for your PS2K , generally it can be found with this ID PNP0303 / PNP030B

Locate it and add

CODE
    Method (_DSM, 4, NotSerialized)  
                                    {
                                        Store (Package (0x02)
                                            {

                                                "AAPL,has-embedded-fn-keys",
                                                Buffer (0x04)
                                                {
                                                    0x01, 0x00, 0x00, 0x00
                                                }

                                            }, Local0)
                                        DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                                        Return (Local0)
                                    }


So that it becomes something like this (the final product)
CODE
Device (PS2K)
                {
                    Name (_HID, EisaId ("PNP0303"))
                    Name (_CID, EisaId ("PNP030B"))
                    Method (_DSM, 4, NotSerialized)  
                                    {
                                        Store (Package ()
                                            {

                                                "AAPL,has-embedded-fn-keys",
                                                Buffer (0x04)
                                                {
                                                    0x01, 0x00, 0x00, 0x00
                                                }

                                            }, Local0)
                                        DTGP (Arg0, Arg1, Arg2, Arg3, RefOf (Local0))
                                        Return (Local0)
                                    }
                    Method (_STA, 0, NotSerialized)
                    {
                        Return (0x0F)
                    }

                    Name (_CRS, ResourceTemplate ()
                    {
                        IO (Decode16,
                            0x0060,             // Range Minimum
                            0x0060,             // Range Maximum
                            0x00,               // Alignment
                            0x01,               // Length
                            )
                        IO (Decode16,
                            0x0064,             // Range Minimum
                            0x0064,             // Range Maximum
                            0x00,               // Alignment
                            0x01,               // Length
                            )
                        IRQNoFlags ()
                            {1}
                    })


Its still missing few other stuff , however I'll dig deeper on how this whole ADB thingy works. This is a work in progress. I am still looking for more keys and possibility of remapping the keys within DSDT.

edit #2 - going to ditch this , we need to improvise on ps2kext especially for acpi calls !
Slice
I think it is nonsense.
The ApplePS2 driver doesn't use this information.
This key was origin from Real Mac with USB (or ADB?) keyboard so don't use this for PS2!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2012 Invision Power Services, Inc.