Page 1 of 1
Bind keyboard and mouse to specific window
Posted: 25 Aug 2012, 20:08
by awmn34
Hello, newbie here, with my first question:
Is it possible to use HIDmacros and its keyboard detection feature to use a 2nd keyboard exclusively with a specific window?
To give you an idea, I' thinking of running XBMC on my 2nd monitor (TV, actually) and allow the rest of the family control it, while I am using the pc
Thank you,
Manolis
Re: Bind keyboard and mouse to specific window
Posted: 27 Aug 2012, 07:42
by admin
No, currently it's not possible.
Re: Bind keyboard and mouse to specific window
Posted: 10 Feb 2016, 01:47
by andersbrontosaurus
Bumping this question.
I have a similar question.
I want to send keystrokes from one keyboard to a specific window and keystrokes from another keyboard to another specific window.
Can this be done with HIDMacros or does someone have another brilliant suggestion?
The reason for my question is that I want to control different machines in Jeskola Buzz.
Thanks in advance

Re: Bind keyboard and mouse to specific window
Posted: 11 Feb 2016, 09:10
by admin
This is not currently possible. Long time ago I was trying to send keys directly to application window (even inactive) but never worked.
Maybe you could activate the window first and then send keystrokes via some script... never tried.
Also in Hidmacros you can not define macro for whole keyboard, you would have to set macro for each key. Global macro can be defined in LuaMacros
Re: Bind keyboard and mouse to specific window
Posted: 15 Feb 2016, 22:16
by ReallyBigTeeth
I have done something like what you are asking for. I wrote vbscripts for each key of a cheap number pad keyboard. The scripts do an "appactivate" for a specific window/program, then send the keystroke or key combination that I want sent to that specific open window.
Here is an example of a script that sets windows focus on an open pdf document, sends a down arrow keystroke (this switches to the next page in the pdf while it's full screen mode), then switches focus back to the window I was previously in using the ALT+TAB combination:
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.AppActivate " - Adobe Acrobat Reader DC"
WshShell.SendKeys "{DOWN}"
WshShell.SendKeys "%{TAB}"
Create 104 scripts per keyboard then map them to your keyboard keys using HIDMacros. It's a bit of work, but it would do what you want.
Re: Bind keyboard and mouse to specific window
Posted: 24 Jun 2020, 21:17
by allan
admin wrote: ↑11 Feb 2016, 09:10
This is not currently possible. Long time ago I was trying to send keys directly to application window (even inactive) but never worked.
Maybe you could activate the window first and then send keystrokes via some script... never tried.
Also in Hidmacros you can not define macro for whole keyboard, you would have to set macro for each key. Global macro can be defined in LuaMacros
Is there a way to do this with LuaMacros by now - without activating the window first? It looks like it's possible (to send command to another window) with AutoHotKey:
https://www.reddit.com/r/AutoHotkey/com ... ve_window/
Re: Bind keyboard and mouse to specific window
Posted: 25 Jun 2020, 07:57
by admin
Technically there's probably some way how to do it but no, not currently implemented in luamacros.
Re: Bind keyboard and mouse to specific window
Posted: 06 Apr 2021, 07:42
by Markstern
Hey guys, I realise this thread is almost a teenager by now but to answer the questions (and perhaps someone else browsing it in the future to find an answer to this) as to whether its possible:
It IS possible to do what several of you want (to control 2 different applications using 2 different HIDs simultaneously) without any custom scripting or the like; The answer is to put one of the applications in a virtual machine environment. I use VMware Workstation for running these myself, and it supports permanently binding devices to VMs. Thus if you bind say a monitor and a keyboard to a VM running (likely an OS supported by the application in question) it will mount said devices in the VM making them exclusively control it.
Hope that helps someone. Best regards // Marc