Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 655834 Details for
Bug 622902
genpatches Please add patch to hid-apple.c (attached)
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch updated for Kernel 5.8.x
hid_apple.patch (text/plain), 3.43 KB, created by
Jorge Millán
on 2020-08-20 23:26:59 UTC
(
hide
)
Description:
Patch updated for Kernel 5.8.x
Filename:
MIME Type:
Creator:
Jorge Millán
Created:
2020-08-20 23:26:59 UTC
Size:
3.43 KB
patch
obsolete
>--- a/drivers/hid/hid-apple.c >+++ b/drivers/hid/hid-apple.c >@@ -57,6 +57,22 @@ > "(For people who want to keep PC keyboard muscle memory. " > "[0] = as-is, Mac layout, 1 = swapped, PC layout)"); > >+static unsigned int swap_fn_f13_insert; >+module_param(swap_fn_f13_insert, uint, 0644); >+MODULE_PARM_DESC(swap_fn_f13_insert, "Swap the Fn and f13 keys, making fn insert and f13 fn. " >+ "(For people who need insert." >+ "[0] = as-is, Mac layout, 1 = swapped)"); >+ >+static unsigned int rightalt_as_rightctrl; >+module_param(rightalt_as_rightctrl, uint, 0644); >+MODULE_PARM_DESC(rightalt_as_rightctrl, "Use the right Alt key as a right Ctrl key. " >+ "[0] = as-is, Mac layout. 1 = Right Alt is right Ctrl"); >+ >+static unsigned int ejectcd_as_delete; >+module_param(ejectcd_as_delete, uint, 0644); >+MODULE_PARM_DESC(ejectcd_as_delete, "Use Eject-CD key as Delete key. " >+ "([0] = disabled, 1 = enabled)"); >+ > struct apple_sc { > unsigned long quirks; > unsigned int fn_on; >@@ -174,6 +190,21 @@ > { } > }; > >+static const struct apple_key_translation swapped_fn_f13_keys[] = { >+ { KEY_FN, KEY_F13 }, >+ { } >+}; >+ >+static const struct apple_key_translation rightalt_as_rightctrl_keys[] = { >+ { KEY_RIGHTALT, KEY_RIGHTCTRL }, >+ { } >+}; >+ >+static const struct apple_key_translation ejectcd_as_delete_keys[] = { >+ { KEY_EJECTCD, KEY_DELETE }, >+ { } >+}; >+ > static const struct apple_key_translation *apple_find_translation( > const struct apple_key_translation *table, u16 from) > { >@@ -197,12 +228,20 @@ > > u16 fn_keycode = (swap_fn_leftctrl) ? (KEY_LEFTCTRL) : (KEY_FN); > >+ if (swap_fn_f13_insert && !swap_fn_leftctrl) >+ fn_keycode = KEY_F13; >+ > if (usage->code == fn_keycode) { > asc->fn_on = !!value; > input_event(input, usage->type, KEY_FN, value); > return 1; > } > >+ if (usage->code == KEY_FN && swap_fn_f13_insert && !swap_fn_leftctrl) { >+ input_event(input, usage->type, KEY_INSERT, value); >+ return 1; >+ } >+ > if (fnmode) { > if (hid->product >= USB_DEVICE_ID_APPLE_WELLSPRING4_ANSI && > hid->product <= USB_DEVICE_ID_APPLE_WELLSPRING4A_JIS) >@@ -276,6 +315,14 @@ > } > } > >+ if (rightalt_as_rightctrl) { >+ trans = apple_find_translation(rightalt_as_rightctrl_keys, usage->code); >+ if (trans) { >+ input_event(input, usage->type, trans->to, value); >+ return 1; >+ } >+ } >+ > if (swap_opt_cmd) { > trans = apple_find_translation(swapped_option_cmd_keys, usage->code); > if (trans) { >@@ -292,6 +339,22 @@ > } > } > >+ if (swap_fn_f13_insert && !swap_fn_leftctrl) { >+ trans = apple_find_translation(swapped_fn_f13_keys, usage->code); >+ if (trans) { >+ input_event(input, usage->type, trans->to, value); >+ return 1; >+ } >+ } >+ >+ if (ejectcd_as_delete) { >+ trans = apple_find_translation(ejectcd_as_delete_keys, usage->code); >+ if (trans) { >+ input_event(input, usage->type, trans->to, value); >+ return 1; >+ } >+ } >+ > return 0; > } > >@@ -360,6 +423,21 @@ > for (trans = swapped_fn_leftctrl_keys; trans->from; trans++) > set_bit(trans->to, input->keybit); > } >+ >+ if (swap_fn_f13_insert && !swap_fn_leftctrl) { >+ for (trans = swapped_fn_f13_keys; trans->from; trans++) >+ set_bit(trans->to, input->keybit); >+ } >+ >+ if (ejectcd_as_delete) { >+ for (trans = ejectcd_as_delete_keys; trans->from; trans++) >+ set_bit(trans->to, input->keybit); >+ } >+ >+ if (rightalt_as_rightctrl) { >+ for (trans = rightalt_as_rightctrl_keys; trans->from; trans++) >+ set_bit(trans->to, input->keybit); >+ } > } > > static int apple_input_mapping(struct hid_device *hdev, struct hid_input *hi,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 622902
:
478268
| 655834