Jump to content

Details about the Enhanced Keyboard for Smart Touchpad driver


EMlyDinEsH

Recommended Posts

SmartTouchpad_Logo.png


 
 
Following are the fixes and features added to the keyboard by Smart touchpad driver:

  • Integrated deeply with Elan touchpad driver in order to get the some of the élan features to work.
  • Rewritten keyboard keys dispatch and processing from the scratch.
  • Mapped Fn key scan codes from Acer, Asus, Dell, MSI, GIGABYTE and Samsung to ADB codes of OSX functions
  • Added support for extended function keys F13-F24 simulation using Shift + F1 - 12
  • Added option to create custom OSX shortcuts using three key combinations which can be assigned to Extended Function keys.
  • Added ISO layout option which can be enabled/disabled by editing the plist entry "Use ISO Layout" to Yes/No (or) true/false.
  • Added option to detect keyboard with Apple Keyboard layouts (Read Keyboard layout post below).
  • Added new Fn key mode feature (Read Fn keys mode post for details)
  • ​Added keyboard shortcuts for enabling/disabling the touchpad features
  • Added support for Asus keyboard backlight
  • Added option to map Delete to Command + backspace shortcut
  • Added option to map Num Lock to Clear
  • Added option to disable Num Lock LED status
  • Added option to configure right Context menu, ALT and Control keys with different values
  • Added custom keyboard layout to fix the keys which are not mapped properly
  • ​Added option to make Shift + Caps lock combination to act as Fn key
  • ​Added option to choose finer brightness and volume controls
  • Assigned Print Screen key to the OSX Screen capture shortcut
  • Assigned Control + Pause/Break key to eject Optical drive
  • Assigned Scroll Lock key for enabling/disabling Inertial and Continuous(hold ALT key)  scroll
  • Assigned Context menu key to show Contextual menu
  • Fixed not working Num Lock and its LED status by soft control
  • ​and many other improvements.
  • Like 4
Link to comment
Share on other sites

Fn Keys Mode:
I've implemented this feature in order to simulate the Fn key functions of Apple for the notebooks which has real Fn keys not working and also to provide/improve the keyboard experience close to Apple keyboard. There are three modes in this feature.
They are:

Note: In version 3.0.2 (or) lesser, ApplePS2Keyboard kext is found inside the ApplePS2Controller kext. From v3.3, ApplePS2Keyboard is located inside ApplePS2ElanTouchpad and From v4.2 its in ApplePS2SmartTouchpad kext.

Mode 1

  • works without Fn key press and has Apple keyboard Fn key Mappings by default
  • It overrides the regular function keys(F1 - F12) with Fn keys, so to access those regular function keys you need to Hold "Shift + Caps" and press the respective Function key to access.
  • uses the Fn key mapping values from the plist entry "Fn Keys Mode 1"
  • you can change these mappings as you like by using the allowed keys and editing the plist file "ApplePS2Keyboard.kext/Contents/Info.plist" at the section "IOKitPersonalities->ApplePS2Keyboard->Fn keys Mode 1"

Mode 2

  • works using the Context menu key (or Hold "Shift + Caps") as Fn key and has my custom Fn key mappings
  • uses the Fn key mapping values from the plist entry "Fn Keys Mode 2"
  • you can also change these mappings as you like by using the allowed keys and editing the plist file "ApplePS2Keyboard.kext/Contents/Info.plist" at the section "IOKitPersonalities->ApplePS2Keyboard->Fn keys Mode 2".

Mode 3

  • works using the Context menu key (or Hold "Shift + Caps") as Fn key but has Fn key mapping of the Notebook vendor
  • uses the Fn key mapping used by the notebook vendor like Dell, Samsung, Acer and Asus.
  • for vendor mapping you need to edit the plist entry "Fn keys Layout" to the vendor values explained below.

 

Allowed vendor values for the Fn keys Layout:
'NONE' clears the mapping and makes the mode like disabled. I meant this value to provide vendor mapping of the Fn keys positions in Fn key mode 3 and fix some of the minor issues of Fn keys in my driver for few notebooks, because there are some scan codes used by Fn keys which are getting conflicts in ADB-scan code mapping due to each vendor doing different functions for the same scan code.

  • ASUS
  • ACER
  • DELL
  • SAMSUNG
  • MSI
  • GIGABYTE
  • LENOVO
  • NONE

 

Allowed key values for mapping the Fn key functions are:

  • F1 - F12, Pause, ArrowDown, ArrowUp, ArrowLeft and ArrowRight.
  • Enter the value "disable" in plist for disabling the Fn key mapping you don't want.

You can enable/disable this feature by editing the plist entry "Fn keys Mode" to the below values:

  • 0 - to disable Fn keys mode
  • 1 - 3 - each mode works like I've explained above

 

 

Use Right context menu key 8744268475_8a6afa765b_t.jpg (or) Hold "Shift + Caps" for mode 2

 

 

 

Mode2_small.png


Fn Key Mode 2

  • F1 - Sleep
  • F3 - Misson control
  • F3 - KBBacklightDown(Asus keyboard backlight)
  • F4 - Launchpad
  • F4 - KBBacklightUp (Asus keyboard backlight)
  • F5 - Brightness decrease
  • F6 - Brightness increase
  • F7 - Display sleep
  • F8 - Video Mirror
  • F9 - Disable/Enable Touchpad
  • F10 - Volume Mute
  • F11 - Volume decrease
  • F12 - Volume increase
  • Left Arrow - Media Previous (Media Rewind on key Hold)
  • Down Arrow - Play/Pause
  • Right Arrow - Media Next (Media Fast on key Hold)
  • Pause/Break key - Context menu

 

 

Mode1_small.png

Fn Key Mode 1

  • F1 - Brightness decrease
  • F2 - Brightness Increase
  • F3 - Mission control
  • F3 - KBBacklightDown(Asus keyboard backlight)
  • F4 - Launchpad
  • F4 - KBBacklightUp (Asus keyboard backlight)
  • F5 - Display Sleep
  • F6 - Video Mirror
  • F7 - Media Previous (Media Rewind on key Hold)
  • F8 - Media Play/Pause
  • F9 - Media Next (Media Fast on key Hold)
  • F10 - Volume Mute
  • F11 - Volume decrease
  • F12 - Volume increase
  • Pause/Break Key - Enable/Disable touchpad

 

NOTE: Display sleep disables both keyboard and Touchpad, so if you try to wake the screen other than Fn + Fx combination then both keyboard and touchpad are not enabled back. You need to press "ESC" key to enable them back.

  • Like 3
Link to comment
Share on other sites

Keyboard layout ID:
This is only meant for ISO keyboard which needs to be detected using an ISO keyboard layout for the some keys to work. This is optional and is not needed for ANSI/Japanese keyboards, but you can use if you want the keyboard to be detected with an Apple keyboard layout. Default Keyboard type is set to Cosmo layout for ISO, PS2 layout Type for ANSI.
 

To configure keyboard layout id, enter the keyboard id decimal value at the plist entry "IOKitPersonalities->ApplePS2Keyboard->Keyboard type(ID)" from the plist file "info.plist" inside the AppplePS2Keyboard kext.     

 

Keyboard ID(0xXX)  /* Comments */

 

0x03  /* Unknown ANSI keyboard */

0x1B  /* Default Apple PS2 Controller ANSI keyboard */

0x2F  /* Apple M89 Wired (ISO) Keyboard */

0x2C  /* Apple M90 Wireless (ISO) Keyboard */

0xC6  /* Gestalt Cosmo USB Domestic (ANSI) Keyboard */

0xC7  /* Cosmo USB International (ISO) Keyboard */

0xC8  /* Cosmo USB Japanese (JIS) Keyboard */

0xCC  /* Andy USB Keyboard Domestic (ANSI) Keyboard */

0xCD  /* Andy USB Keyboard International (ISO) Keyboard */

0xCE  /* Andy USB Keyboard Japanese (JIS) Keyboard */

0x1F  /* Apple Q6 Keyboard Domestic (ANSI) Keyboard */

0x20  /* Apple Q6 Keyboard International (ISO) Keyboard */

0x21  /* Apple Q6 Keyboard Japanese (JIS) Keyboard */

0x22  /* Apple Q30 Keyboard Domestic (ANSI) Keyboard (or) USB Pro Keyboard w/ F16 key Domestic (ANSI) Keyboard */

0x23  /* Apple Q30 Keyboard International (ISO) Keyboard (or) USB Pro Keyboard w/ F16 key International (ISO) Keyboard */

0x24  /* Apple Q30 Keyboard Japanese (JIS) Keyboard (or) USB Pro Keyboard w/ F16 key Japanese (JIS) Keyboard */

0x25  /* Apple Santa/Fountain Keyboard Domestic (ANSI) Keyboard */

0x26  /* Apple Santa/Fountain Keyboard International (ISO) Keyboard */

0x27  /* Apple Santa/Fountain Keyboard Japanese (JIS) Keyboard */

0x30  /* German and (Turkish? may be) ISO Keyboard */

0x31  /* Spanish and Italian ISO Keyboard */

0x32  /* French ISO Keyboard */

0x33  /* Brazilian ABNT2 Keyboard */

  • Like 2
Link to comment
Share on other sites

Keyboard Configuration in plist:

 

The following are the things that can be configured in the plist for the keyboard. You can find these at the section "IOKitPersonalities->ApplePS2Keyboard" from the file "info.plist" located inside the kext "ApplePS2ElanTouchpad.kext/Contents/Plugins/ApplePS2Keyboard.kext/Contents/" .

 

Note: In version 3.0.2 (or) lesser, ApplePS2Keyboard kext is found inside the ApplePS2Controller kext. From v3.3, ApplePS2Keyboard is located inside ApplePS2ElanTouchpad/ApplePS2SmartTouchpad kext.

  • Use ISO Layout : Yes/No (or) true/false - Enables/disables the ISO layout 
  • Keyboard type (ID) : decimal value - Enables the keyboard to be detected with the Apple layout value we provide.
  • Fn keys Mode : 0-3 - Sets the Fn keys mode (Read second post for details)
  • Fn keys Layout : Vendor string - Allows the Fn key mode 3 to use the vendor layout for Fn key positions and fixes some Fn keys of issues in avoiding conflicts of scan codes-ADB mapping. (Read second post for details)
  • Debug : Yes/No (or) true/false :- Enables debug logs for keyboard.

You can find the below options at the section "IOKitPersonalities->ApplePS2Keyboard->Preferences" from the file "info.plist" located inside the kext "ApplePS2SmartTouchpad.kext/Contents/Plugins/ApplePS2Keyboard.kext/Contents/" . (for old versions ApplePS2ElanTouchpad.kext)

  • Swap alt and windows key :  Yes/No (or) true/false - Swaps ALT and Windows keys positions to match Command key position of Apple keyboard.
  • Make context Menu key into key - decimal value : Makes the context menu key to act like the value we provide from "Allowed modifier values".
  • Make right control into key - decimal value : Makes the right control key to act like the value we provide from "Allowed modifier values".
  • Make right alt into key - decimal value : Makes the right alt key to act like the value we provide from "Allowed modifier values".
  • Make Caps Lock into key - decimal value : Makes the Caps lock key to act like the value we provide from "Allowed modifier values".
  • Make ISO keypad key . to , - decimal value : Makes the '.' key to act as ',' in ISO keyboard.
  • Make shift + caps into Fn key - Yes/No (or) true/false : enable shift + caps key combination to act as Fn key?
  • Make delete key into cmd + backspace - Yes/No (or) true/false : Enable delete key to act as command + backspace shortcut which can delete files?
  • Make Num Lock into Clear - Yes/No (or) true/false : Enable Num Lock key to act as Clear?
  • Enable Extended Functions - Yes/No (or) true/false : Enable extended function keys with Shift + F1-F12?
  • Num Lock enabled at boot - Yes/No (or) true/false : Enable num lock at boot?
  • Disable Num Lock LED - Yes/No (or) true/false : Disable num lock LED status on toggle?
  • FinerFnBrightnessControl - Yes/No (or) true/false : Enable finer control for smaller brightness levels in Fn keys mode?
  • FinerFnVolumeControl - Yes/No (or) true/false : Enable finer control for smaller volume levels in Fn keys mode?

Allowed modifier values for the Context menu, right control and alt:

Left command   - 0x5B , Decimal - 91

Right command - 0x5C , Decimal - 92

Right control      - 0x1D , Decimal - 29

Right option       - 0x38 , Decimal - 56

Context Menu    - 0x5D, Decimal - 93

Fn Key                - 0x54, Decimal - 84

ESC                    - 0x01, Decimal - 01

  • Like 2
Link to comment
Share on other sites

Touchpad Features shortcuts:

 

I've added few keyboard shortcuts shortcuts for enabling/disabling some of the touchpad features. This is can be triggered using Left Shift, Caps Lock and a character key which represents the feature.

 

Its done like this: Hold Left Shift + Caps Lock and press "Feature Character"

NOTE: You need to Hold Left shift first then Hold Caps Lock next and finally press the character.

 

This will make caps lock LED to blink (or) pointer moving a bit up/down for touchpad features to indicate its been triggered.

 

For Auto scroll - 'A'

For Inertial scroll - 'I'

For Continuous scroll - 'C'

For Edge scroll - 'S'

For Zoom - 'Z'

For Rotate - 'R'

For Edge swipe - 'E'

For Three finger swipes - 'T'

For Four finger swipes - 'M'

For Fn keys mode - 'F'

For ALT and Windows keys swap - 'K'

For Extended functions - 'X'

For finer brightness control toggle - 'B'

For finger volume control toggle - 'V'

  • Like 1
Link to comment
Share on other sites

Extended function keys Customization:
You can customize the extended function keys F13-24 using three key combination shortcuts. All the Alphabets, special characters, numbers and Modifiers are supported for making the key combination.

Extended functions can be configured by editing the plist entry "IOKitPersonalities->ApplePS2Keyboard->Extended Functions" from keyboard plist.

Its syntax: KEY1 KEY2 KEY3
Each key is separated by a space and you should use the values i've provided below for the key.



Extended_small.png

 

Default key combinations assigned to the extended function keys are:
F13 - ALT CMD ESC
F14 - None (Works as OSX F14 for brightness)
F15 - None (Works as OSX F15 for brightness)
F16 - ALT CMD D
F17 - CTRL DAW
F18 - CTRL UAW
F19 - CTRL LAW
F20 - CTRL RAW
F21 - None
F22 - None
F23 - CMD Q
F24 - CMD H

ALPHABETS, SPECIAL CHARACTERS And NUMBERS:
'A' - 'Z'
'0' - '9'
'`'
'-'
'+'
'['
]'
'\'
'/'
'.'
',':
'''
';'

MODIFIERS:
Command - 'CMD'
Control - 'CTRL'
Shift - 'SHFT'
Escape - 'ESC'
Enter - 'ENTR'
Space - 'SPCE'
Tab - 'TAB'
Down Arrow - 'DAW'
Up Arrow - 'UAW'
Left Arrow - 'LAW'
Right Arrow - 'RAW'

  • Like 1
Link to comment
Share on other sites

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