free5lot / hid-apple-patched

Allows to swap the Fn key and left Control key and other tweaks on Macbook Pro and Apple keyboards in GNU/Linux
GNU General Public License v2.0
350 stars 61 forks source link

Add option to allow fn to function as additional control key, and not modify existing control key #28

Closed aarobc closed 8 years ago

aarobc commented 8 years ago

Reason being if I'm moving between a usb keyboard and the laptop keyboard, I want to be able to still use the original control key mapping as well.

free5lot commented 8 years ago

Hi @aarobc. It may deserve consideration, but how do you use Fn key then? How to press Delete (Fn+Backspace), Home, Page Up?

aarobc commented 8 years ago

Indeed I'd lose that functionality. Ideally I'd like to be able to have the remap apply only if there is no external keyboard attached. Perhaps set up a udev rule.

Are there commands to enable/disable the fn remap without having to reboot?

free5lot commented 8 years ago

Are there commands to enable/disable the fn remap without having to reboot?

Yes, look in install.sh for a sample of use. Something like: Reload module with new options:

sudo rmmod "$MODULE_LSMOD_NAME"
sudo insmod "./$MODULE_FILENAME" $SAVED_OPTIONS swap_fn_leftctrl="$SWAP_FN_LEFTCTRL" ejectcd_as_delete="$EJECTCD_AS_DELETE"

Or change options without reload:

echo "$SWAP_FN_LEFTCTRL"  | sudo tee "/sys/module/hid_apple/parameters/swap_fn_leftctrl"
echo "$EJECTCD_AS_DELETE" | sudo tee "/sys/module/hid_apple/parameters/ejectcd_as_delete"

Where $XXX - are variables, you can replace them with fixed strings and numbers.

aarobc commented 8 years ago

This is a suitable solution. Thanks for your assistance.

free5lot commented 8 years ago

You're welcome. Happy, it helped.