Karabiner-Elements icon indicating copy to clipboard operation
Karabiner-Elements copied to clipboard

Allow complex modifications per device in the GUI

Open rggjan opened this issue 6 years ago • 58 comments

There are some complex modifications (rules) I would like to enable only on my external keyboard. It would be great if this could be enabled, the same way as the simple modifications and Function keys can be set individually per device.

rggjan avatar Oct 30 '17 07:10 rggjan

I need exactly the same thing. Now, I have to disable all the other devices completely in the "Devices" tab in order to prevent that my rules apply to these devices also. I should be possible to restrict complex rules to individual devices.

weibeld avatar Nov 02 '17 17:11 weibeld

It's a workaround, but not exactly the same thing. With this solution, it's not possible to have different complex modifications for different devices at the same time (i.e. in the same profile).

I think with the old Karabiner this was possible. You just defined a set of applications and a set of devices, and then you could restrict each rule to an application and a device. With the new Karabiner-Elements, each complex modification rule can be restricted to an application, but not to a device.

2017-11-03 9:04 GMT+01:00 nguyenhimself [email protected]:

Isn't that how 'Profiles' already works currently? I have 4 sets of configs and complex rules on my machine.

In fact, thanks to an automatically-enabled macro in Keyboard Maestro, I don't even need to do anything. Just plug in an external keyboard and the correct profile is selected.

[image: screen shot 2017-11-03 at 3 00 27 pm] https://user-images.githubusercontent.com/482270/32364510-d7f6b25a-c0a7-11e7-8dad-ecf31a0d4bfa.png

[image: screen shot 2017-11-03 at 3 03 13 pm] https://user-images.githubusercontent.com/482270/32364557-243ae5e6-c0a8-11e7-91ec-a30c2cbef0c4.png

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tekezo/Karabiner-Elements/issues/1073#issuecomment-341640964, or mute the thread https://github.com/notifications/unsubscribe-auth/ACSQMG3AOt1jxKcEXbNGhcne18ZMFejfks5syskcgaJpZM4QKyGx .

weibeld avatar Nov 03 '17 09:11 weibeld

I just saw that it is actually possible with the "device_if" condition in complex modification rules, as demonstrated here (referenced from #979).

So, I think this issue can be closed.

weibeld avatar Nov 03 '17 14:11 weibeld

@weibeld Great to know there is a way to do it. However, I still think this is not very user friendly, especially when importing rules from the Internet: These would have to be downloaded, manually edited by hand and then reimported into Karabiner-Elements again, right? Not something the average user can do when he imports some predefined rules from others...

rggjan avatar Nov 06 '17 09:11 rggjan

Yes, basically. When you import a rule from the Internet through the Karabiner-Elements GUI, it gets saved as a JSON file in the following directory (this is also where you save your own rules):

~/.config/karabiner/assets/complex_modifications

There you can edit it by hand, and then you can enable the rule in the GUI (if you already enabled it before, then you have to remove the rule and add it again in order to reload the changes).

I think too it's not very user-friendly. There should be a section in the UI where you can declare devices (by their vendor ID and product ID) and a section where you can declare apps (by their app ID). And then there should be a function in the GUI to freely add devices and/or apps to individual rules, to restrict the rules to these devices/apps.

Also, now you have to repeat each device/app condition for each keystroke inside a rule, which I think is unnecessary too. It would be enough to set device and app conditions for an entire rule as a whole.

weibeld avatar Nov 06 '17 16:11 weibeld

Thanks for the explanation! I agree it would be better to be able to do this in the GUI. It is already possible for the simple rules, so this shouldn't be too hard to implement, or am I wrong?

rggjan avatar Nov 06 '17 19:11 rggjan

I'm not familiar with the source code, I think it would require some substantial changes, but certainly it's not impossible.

I also think JSON is not a good idea for configuration files that are supposed to be edited by hand. That's one of the first things I would change too.

weibeld avatar Nov 07 '17 08:11 weibeld

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 03 '18 23:03 stale[bot]

Still interested in this, please don't close it

rggjan avatar Mar 05 '18 10:03 rggjan

This looks related to (and maybe a dupe of) https://github.com/tekezo/Karabiner-Elements/issues/979?

FuegoFro avatar Mar 07 '18 00:03 FuegoFro

No, #979 is still about modification of the json file. I would like to see it in the UI instead... On Wed, 7 Mar 2018 at 01:15, Danny Weinberg [email protected] wrote:

This looks related to (and maybe a dupe of) #979 https://github.com/tekezo/Karabiner-Elements/issues/979?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/tekezo/Karabiner-Elements/issues/1073#issuecomment-370976266, or mute the thread https://github.com/notifications/unsubscribe-auth/AAH2Ks1V44l5kMsn82HIw5V0ijgH8OK3ks5tbyaTgaJpZM4QKyGx .

rggjan avatar Mar 07 '18 07:03 rggjan

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar May 06 '18 08:05 stale[bot]

Still interested in this, please don't close...

rggjan avatar May 07 '18 07:05 rggjan

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jul 06 '18 07:07 stale[bot]

Still interested in this, please don't close...

rggjan avatar Jul 06 '18 08:07 rggjan

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Sep 04 '18 09:09 stale[bot]

Still interested in this, please don't close...

rggjan avatar Sep 04 '18 09:09 rggjan

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Nov 03 '18 10:11 stale[bot]

Maybe I should write a bot which keeps replying to the other bot that I'm still interested in this feature... 😜

rggjan avatar Nov 04 '18 13:11 rggjan

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Jan 03 '19 21:01 stale[bot]

Still interested in this, please don't close...

rggjan avatar Jan 04 '19 10:01 rggjan

Also interested please don't close

JordanPeterson avatar Jan 16 '19 17:01 JordanPeterson

Very interested in this

jayache80 avatar Jan 28 '19 08:01 jayache80

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 29 '19 09:03 stale[bot]

Still interested in this

jayache80 avatar Mar 29 '19 16:03 jayache80

I'd really like to see this as well, and am glad to see there's an issue for it.

petergaultney avatar May 04 '19 14:05 petergaultney

interested as well. Hope somebody figure this out somehow

RexYuan avatar Jun 12 '19 17:06 RexYuan

This is already implemented as the device_if condition (can someone copy to the top). @rggjan can you update your question description with the answer - Thanks!!

See:

     "conditions": [
        {
          "type": "device_if",
          "identifiers": [
            {
              "vendor_id": 1278,
              "product_id": 515
            }
          ]
        }
      ],

idvorkin avatar Jun 14 '19 13:06 idvorkin

Hi @idvorkin. Thanks! However, I'm specifically asking for making this possible via UI (eg download and activate a predefined complex modification for only one device vi UI, without messing with config files). Sorry for not being clear about that.

rggjan avatar Jun 15 '19 07:06 rggjan

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Aug 15 '19 05:08 stale[bot]