TaranVH / 2nd-keyboard

ALL of Taran's scripts - not just for the 2nd keyboard.
https://www.youtube.com/watch?v=O6ERELse_QY
1.67k stars 534 forks source link

Cannot separate my standard keyboard and the macro board #86

Open Zelatrix opened 5 years ago

Zelatrix commented 5 years ago

I am trying to get the second keyboard working with Lua Macros, and I can get it working inside of LM; when I press a key on the second keyboard, it will write to the file on disk, but when I launch my AHK script, both of my keyboards will trigger the macros that I have defined inside that script. How do I separate the macro keyboard from the normal one, so that I can use one in standard typing?

Wegerich commented 5 years ago

It sounds like LM is taking input from both keyboards and using it to write to the file, which AHK is reading?

In which case the problem is in Lua Macros, and your device ID is probably not set properly.

Try plugging your 2nd keyboard into a different USB port then, what does this part of your code say?

-- 'Set this to 0000AAA for your first run
local keyboardIdentifier = '0000AAA'    
Zelatrix commented 5 years ago

That part of my code remains the same. Why would changing the USB port edit the code? Also, you say I might not be entering the device ID correctly. If I have the following message in the terminal, which part would be the ID?


  Handle = 141428825
  SystemId = \\?\HID#VID_046D&PID_C31C&MI_00#7&6E38DAB&0&0000#{884B96C3-56EF-11D1-BC8C-00A0C91405DD}
  Name = MACROS
  Type = keyboard
TaranVH commented 5 years ago

Are they both the same model of keyboard? if so, it won't work.

Zelatrix commented 5 years ago

One of my keyboards is an Aukey keyboard, and the other one is a Logitech board.

TaranVH commented 5 years ago

I'm not able to help. It's been years since I've used luamacros.

Matesaktesak commented 5 years ago

A stupid question (don't take it bad), but does your AHK really fire with the things that are written in the file, or does it fire on a keypress? (Like A:: Return)

Zelatrix commented 5 years ago

It fires according to an if else statement. Like

If (key == 'q')
{
     ; Do something
}
Wegerich commented 5 years ago

@Zelatrix Your ID would be 6E38DAB in that case.

Changing the USB port doesn't change the code but it can change the device ID in my experience.

Matesaktesak commented 5 years ago

@Zelatrix Ok, when you type on the "typing" keyboard, does the file change?

PotatoJet commented 4 years ago

Please use QMK and close this issue!