Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple external keyboards #6

Closed
Trefex opened this issue May 15, 2017 · 8 comments
Closed

Multiple external keyboards #6

Trefex opened this issue May 15, 2017 · 8 comments

Comments

@Trefex
Copy link
Contributor

Trefex commented May 15, 2017

Do you think it could be possible to manage 2 external keyboards?

Currently it only remembers the settings for 1 external keyboard, even when 2 are used.

Cheers,

@somaGFX
Copy link

somaGFX commented May 30, 2017

It's a great app. For sure.

But...yesterday I installed your app. Works good and I could handle the german location settings for my german magic keyboard and it switched the location to english(international) when I used my english magic keyboard. but today after a reboot it handles settings for just USB or Bluetooth. Every bluetooth keyboad has now the english location (or what ever you selected) and every usb keyboard has the other location.
That's inappropriate because I use the two different bt keyboards.

Is there a workaround for that problem? And on the other hand, why did it work for the first time and after the reboot not? It's strange, isn't it?

@jeantil
Copy link
Owner

jeantil commented Jun 2, 2017

Hello soma,

I will get myself a 2nd external keyboard to try and understand what's going on. I was fairly sure that
the combination of ( product/vendorId/productId ) would be enough to distinguish between 2 different devices but it seems not.
As I explain in the pull request, I am not willing to add the locationId as it would effectively bind the mapping to a specific usb port (as far as I understand the API)

if you are willing to compile the source and add a print statement that lists the identifying keys that would be helpful..

thanks

@Trefex
Copy link
Contributor Author

Trefex commented Jun 2, 2017

The reason i made a PR with locationid is because with two external keyboards the mapping is not unique anymore. Especially if it's the same keyboard type, which would effectively have the same productid.

@jeantil
Copy link
Owner

jeantil commented Jun 2, 2017

I understand why you made the PR, and how the key I used up until now may not be unique. What I disagree with is using LocationId :) So I have to find fields which the usb vendors/manufacturers actually DO fill (unlike serial number for instance) which could be used to uniquely identify
devices without tying them to a specific physical port.

there are a few which seem promising:

#define kIOHIDTransportKey                  "Transport"
#define kIOHIDVendorIDKey                   "VendorID"
#define kIOHIDVendorIDSourceKey             "VendorIDSource"
#define kIOHIDProductIDKey                  "ProductID"
#define kIOHIDVersionNumberKey              "VersionNumber"
#define kIOHIDManufacturerKey               "Manufacturer"
#define kIOHIDProductKey                    "Product"
#define kIOHIDSerialNumberKey               "SerialNumber"
#define kIOHIDCountryCodeKey                "CountryCode"
#define kIOHIDLocationIDKey                 "LocationID"
#define kIOHIDDeviceUsageKey                "DeviceUsage"
#define kIOHIDDeviceUsagePageKey            "DeviceUsagePage"
#define kIOHIDDeviceUsagePairsKey           "DeviceUsagePairs"
#define kIOHIDPrimaryUsageKey               "PrimaryUsage"
#define kIOHIDPrimaryUsagePageKey           "PrimaryUsagePage"
#define kIOHIDMaxInputReportSizeKey         "MaxInputReportSize"
#define kIOHIDMaxOutputReportSizeKey	    "MaxOutputReportSize"
#define kIOHIDMaxFeatureReportSizeKey	    "MaxFeatureReportSize"
#define kIOHIDReportIntervalKey             "ReportInterval"

from https://opensource.apple.com/source/IOHIDFamily/IOHIDFamily-247/IOHIDFamily/IOHIDKeys.h

@Trefex
Copy link
Contributor Author

Trefex commented Jun 2, 2017 via email

@jeantil
Copy link
Owner

jeantil commented Jun 2, 2017

I have created a branch feat/track-multiple-location with a verbose output which lists most of the keys above.

  • compile the app from source on that branch (see the readme)
  • start it
  • press 2 keys on each keyboards
    then please paste the output here

thanks

@jeantil
Copy link
Owner

jeantil commented Oct 23, 2017

@Trefex I have added a command line parameter to make autokbisw use the keyboard locationId as identifier.

@Trefex
Copy link
Contributor Author

Trefex commented Oct 23, 2017

Great thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants