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

Ability to set a default keyboard on startup #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Ability to set a default keyboard on startup #6

wants to merge 1 commit into from

Conversation

possum888
Copy link

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.

<unassigned>  :  \\?\HID#VID_045E&PID_0745&MI_00#7&8C8C8AF&0&0000#{884B96C3-56EF-11D1-BC8C-00A0C91405DD} [65599] :  keyboard
MACROS  :  \\?\HID#VID_24F0&PID_0140&MI_00#8&4784382&0&0000#{884B96C3-56EF-11D1-BC8C-00A0C91405DD} [65597] :  keyboard
Total number of devices: 2

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.

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.
@darkgallium
Copy link

Thank you so much !

@TaranVH
Copy link
Owner

TaranVH commented Aug 31, 2016

Great idea! I will try to implement this soon! YEA!!!

EXCLAMATION MARKS!!!!!!!!!!!!!!!!!!!!!!!!

Copy link
Contributor

@Wegerich Wegerich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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 this pull request may close these issues.

4 participants