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 wired keyboard support #51

Closed zoxpx closed 8 months ago

zoxpx commented 5 years ago

Additional:

free5lot commented 5 years ago

Thank you @zoxpx for this PR! So, dear uses of this repo, who has these F13-F15 buttons on their keyboard (I don't have them on Macbook Pro) - please try out this new features and tell your opinion. If everything is fine the PR should be accepted as it looks useful.


And @zoxpx I also want to ask you a favor. Your code looks quite fine, and you also modified the docs, that's good. 1) Can you please check if your patch is compatible with PR #50 and if possible provide the second opinion on that PR and it's code (it looks rather simple)?

2) About your patch. The code looks good, the only thing I see is a small possible inconsistency for simultaneous use of swap_fn_leftctrl and swap_fn_f19_and_insert_fn. In hid-apple.c on lines 242-249 you provide the priority: if swap_fn_leftctrl is set then it's primary, otherwise code checks for swap_fn_f19_and_insert_fn and if it's also not set then the default fn button is used. I think it's OK and should be something like that. But later on lines 436-448 you use different approach: swap_fn_f19_and_insert_fn is checked no matter what swap_fn_leftctrl is and happens before swap_fn_leftctrl is checked on line 446. Maybe swap_fn_f19_and_insert_fn should be also ignored there if swap_fn_leftctrl is set, or not? Isn't it an minor inconsistency? Perhaps, my brain is a bit rusty and it can be intentional or maybe not. Is it? Can you explain it a bit.

Thanks for your PR again!