Jump to content

ThinkPad E470: keyboard layout


Guest

Recommended Posts

Hi all...im have a Lenovo ThinkPad E470, and almost everething is fine, working very awesome with @Jake Lo help me !!!

In my case, im have a keyboard layout that not work the keys "?" and "/". My Layout is "Brazilian - ABNT2" .

Its important to me use this keys, and im wish know if was someway to get a copy/clone layout from windows, or something to get this keys working.

Another keys not so important, and Jake gave me a great help with most importants keys,  but if someone could help me, im appreciated that!!

 

IMG_1658.thumb.jpg.d48a96ffbdb28bdead09e4b292077937.jpg

Link to comment
Share on other sites

I Found a good solution to fix the slash/? key on pt_bt layouts of lenovo thinkpad.
Background information:
Followin the apple tn2450 table i found the key code 0x87
https://developer.apple.com/library/archive/technotes/tn2450/_index.html
Now, i follow the apple usb 2 adb table and fount 5e correspondent adb code to 0x87 from hid_adb_2_usb_keymap
https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-606.1.7/IOHIDFamily/Cosmo_USB2ADB.c

to check keyboard events, use ioio -s ApplePS2Keyboard LogScanCodes 1

it to trigger the logging of the adb codes and look at console filtering by "ApplePS2Keyboard"

 

Finally, the simplified solution:

 

Add a custom map in VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Keyboard.kext/Contents/Info.plist

 

The remap: e01d=5e

 

Using PlistBuddy (i have a automated script to build my efi folder)

 

plist=VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Keyboard.kext/Contents/Info.plist
node=':IOKitPersonalities:ApplePS2Keyboard:Platform\ Profile:Default:Custom\ ADB\ Map'

/usr/libexec/PlistBuddy -c "Add ${node}:1 string 'e01d=5e'" $plist

 

manually:

open VoodooPS2Controller.kext/Contents/PlugIns/VoodooPS2Keyboard.kext/Contents/Info.plist

find IOKitPersonalities -> ApplePS2Keyboard -> Platform Profile -> Default -> Custom ADB Map

and add a line <string>e01d=5e</string>

 

results like:

                <key>Default</key>
                <dict>
                    <key>Breakless PS2</key>
                    <array>
                        <string>;Items must be strings in the form of breaklessscan (in hex)</string>
                    </array>
                    <key>Custom ADB Map</key>
                    <array>
                        <string>;Items must be strings in the form of scanfrom=adbto (in hex)</string>
                        <string>e01d=5e</string>
                    </array>
                    <key>Custom PS2 Map</key>
                    <array>

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

At that moment, I got an even better solution, keeping the kext untouched and applying the patch via SSDT according to this code:
 

/*
 * Intel ACPI Component Architecture
 * AML/ASL+ Disassembler version 20200326 (64-bit version)
 * Copyright (c) 2000 - 2020 Intel Corporation
 * 
 * Disassembling to symbolic ASL+ operators
 *
 * Disassembly of SSDT-KBD.aml
 *
 * Original Table Header:
 *     Signature        "SSDT"
 *     Length           0x0000027F (639)
 *     Revision         0x02
 *     Checksum         0x22
 *     OEM ID           "HACK"
 *     OEM Table ID     "KBD"
 *     OEM Revision     0x00000000 (0)
 *     Compiler ID      "INTL"
 *     Compiler Version 0x20200326 (538968870)
 */
DefinitionBlock ("", "SSDT", 2, "HACK", "KBD", 0x00000000)
{
    External (_SB_.PCI0.LPCB.KBD_, DeviceObj)

    Scope (\_SB.PCI0.LPCB.KBD)
    {
        Method (_DSM, 4, NotSerialized)  // _DSM: Device-Specific Method
        {
            If (!Arg2)
            {
                Return (Buffer (One)
                {
                     0x03                                             // .
                })
            }

            Return (Package (0x04)
            {
                "RM,oem-id", 
                "LENOVO", 
                "RM,oem-table-id", 
                "Thinkpad_ClickPad"
            })
        }

        Name (RMCF, Package (0x04)
        {
            "Keyboard", 
            Package (0x02)
            {
                "Custom ADB Map", 
                Package (0x02)
                {
                    Package (0x00){}, 
                    "e01d=5e"
                }
            }, 

            "Synaptics TouchPad", 
            Package (0x28)
            {
                "BogusDeltaThreshX", 
                0x0320, 
                "BogusDeltaThreshY", 
                0x0320, 
                "Clicking", 
                ">y", 
                "DragLockTempMask", 
                0x00040004, 
                "DynamicEWMode", 
                ">n", 
                "FakeMiddleButton", 
                ">n", 
                "HWResetOnStart", 
                ">y", 
                "PalmNoAction When Typing", 
                ">y", 
                "QuietTimeAfterTyping", 
                0x05F5E100, 
                "ScrollResolution", 
                0x0320, 
                "SmoothInput", 
                ">y", 
                "UnsmoothInput", 
                ">y", 
                "Thinkpad", 
                ">y", 
                "EdgeBottom", 
                Zero, 
                "FingerZ", 
                0x1E, 
                "MaxTapTime", 
                0x05F5E100, 
                "MouseMultiplierX", 
                0x02, 
                "MouseMultiplierY", 
                0x02, 
                "MouseScrollMultiplierX", 
                0x02, 
                "MouseScrollMultiplierY", 
                0x02
            }
        })
    }
}


I hope this helps.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...