Ability to set a default keyboard on startup#6
Open
possum888 wants to merge 1 commit intoTaranVH:masterfrom
possum888:master
Open
Ability to set a default keyboard on startup#6possum888 wants to merge 1 commit intoTaranVH:masterfrom possum888:master
possum888 wants to merge 1 commit intoTaranVH:masterfrom
possum888:master
Conversation
Rather than manually pressing a key each time you start the script to identify the keyboard, this will attempt to look for a config.txt file, containing a substring belonging to the keyboard device instance path. If the config file contains a value, it will automatically set the keyboard to the one which contains the substring. I'm using the vendor ID, however you can use any part of the device instance path. If no config file is found, then it will prompt you to press a key, and then print out all detected keyboards. On the line labelled MACROS, you can copy the VID or PID into a new config.txt file to remember that device.
|
Thank you so much ! |
Owner
|
Great idea! I will try to implement this soon! YEA!!! EXCLAMATION MARKS!!!!!!!!!!!!!!!!!!!!!!!! |
Wegerich
reviewed
Oct 10, 2018
Contributor
Wegerich
left a comment
There was a problem hiding this comment.
This seems like a sensible change which would allow the keyboard identifier to be saved outside of the LUAmacros code. This would mean that a user never has to edit the LUA code and instead can just edit this file.
It would require the user to create the file though. It would be ideal to set this up instead in a way that purely requires them to edit a .txt file which would be stored in the repository.
I would personally add
else
lmc_minimize()
After line 20, so if
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rather than manually pressing a key each time you start the script to identify the keyboard, this will attempt to look for a config.txt file, containing a substring belonging to the macro keyboard device instance path.
If the config file contains a value, it will automatically set the keyboard to the one which contains the substring. If no config file is found, it will prompt you to press a key on the macros keyboard, and then print out all detected keyboards.
On the line labelled MACROS, you can copy a portion of the device instance string into a new config.txt file to remember that device. I'm using the vendor ID (
VID_24F0) as my keyboards are two different brands, however you can use any part of the device instance path.