Author Topic: How-To: Individual Hotkeys with multiple keyboards  (Read 15632 times)

0 Members and 1 Guest are viewing this topic.

Offline sixty

  • Thread Starter
  • Posts: 984
    • http://deskthority.net
How-To: Individual Hotkeys with multiple keyboards
« on: Sat, 29 January 2011, 19:04:45 »
TL;DR - SKIP DIRECTLY TO VIDEO VERSION

The Idea

This is something I had been wanting to do for a very long time! I love to have some extra keypads around my desk to accompany my main keyboard. I usually use them for non standard tasks, such as media keys to control my music or shortcuts in Photoshop.

For a task like this most people would use a tool like autohotkey to program macro scripts like these - and that is fine until... what happens if you have more than one keypad or if your actual keyboard has a keypad too? What if you just want a lot of macro keys? Sadly Autohotkey can not tell the difference between the same keys on multiple keyboards.


The Problem

Imagine the following situation:


You have a numpad like this and you want to remap its "Tab" key to do something else - for example to mute your audio. You go ahead and write your Autohotkey script and then realize that the script will also trigger when you hit "Tab" on your main keyboard. Duh! No good. Our plan was not to give up keys, but to gain a few extra ones!

The problem is that autohotkey (and all other macro programs I tried) are unable to tell the difference between several connected input devices. This means every key you assign a macro to, will also trigger on all of your connected keyboards.

The Solution

Recently I stumbled upon a little tool called HID macros. Originally written to be used with Flight Simulators, it is actually able to tell apart keystrokes from multiple connected keyboards!

Quote from: HID Macros Website
This small utility is written mainly for Flight Simluator (with extra feature for FSX Deluxe version), but can be also usefull if you want to activate keyboard macros from special keyboard(s). With latest version 1.5 mouse & game devices support was added (see below).

Key features
manage multiple keyboards/mouses connected to one PC
different key on different keyboard has assigned it's own command
mouse buttons on different mouses can be also used as macro trigeer - including mouse wheel
when a key activates macro, it's own beahvior (e.g. sending letter code to windows) is deactivated
macro can send another keyboard keys, launch application or send command to FSX via SimConnect
when no macro is assigned, keyboard/mouse works as usual

The tool is still pretty unknown and due to its original intention to be used with flight simulators - not very feature rich. The latest beta version allows for some very basic VBScript scripting, but still did not meet my needs. One of the few things that HID Macros can do out of the box is to launch another application. This gave me an idea.

Outsourcing work is always good!

So, HID Macros lacks a lot of features, but lets us launch other applications. Good enough! NirCmd is another little (60kb) standalone tool that kinda acts like a "swiss army knife" for common computing tasks. It gives you access to a ton of functions and commands by simply passing them to the command line parameter. There are dozens of things you can do with this. Just take a look at the massive list of features and examples. NirCmd has no UI and never spawns any visible window. The process ends as soon as the command was executed, invisible and silent.

The idea is to simply use HID Macros to detect a keypress and have it launch NirCmd with the desired parameters. Check  out this little video to give you an idea and conclusion:

Please do yourself a favor and watch this in HD, to actually read the text.

So there you have it, full freedom for your extra keypads or even full keyboards!

Software Used

HID Macros: http://www.hidmacros.eu/
NirCmd: http://www.nirsoft.net/utils/nircmd.html
« Last Edit: Sat, 29 January 2011, 19:10:42 by sixty »

Offline sixty

  • Thread Starter
  • Posts: 984
    • http://deskthority.net
How-To: Individual Hotkeys with multiple keyboards
« Reply #1 on: Sun, 30 January 2011, 11:05:04 »
I just installed the same setup here at the office and I found that it behaves a bit oddly with the US-International keyboard layout. Dead keys (" ') are repeated and do not act as modifiers to create Umlauts anymore. Not sure why this happens, didn't happen at home.

Offline Lanx

  • Posts: 1915
How-To: Individual Hotkeys with multiple keyboards
« Reply #2 on: Sun, 30 January 2011, 11:29:30 »
I have a nostromo and xkeys stick, for the purposes that you've stated. I hate external autohotkey'ish programs and can barely stand the to have the nostromo software in the tray (it is really easy to use tho).

Offline sixty

  • Thread Starter
  • Posts: 984
    • http://deskthority.net
How-To: Individual Hotkeys with multiple keyboards
« Reply #3 on: Sun, 30 January 2011, 11:38:29 »
Quote from: Lanx;287282
I have a nostromo and xkeys stick, for the purposes that you've stated. I hate external autohotkey'ish programs and can barely stand the to have the nostromo software in the tray (it is really easy to use tho).


I'm not a fan of having too much of that stuff running at the same either. But under Windows - currently there seems to be no way around this. At least not on a software base.

Offline dzd

  • Posts: 30
How-To: Individual Hotkeys with multiple keyboards
« Reply #4 on: Mon, 09 January 2012, 13:27:15 »
Hi,

New to the forum and not a programmer or super-hardcore geek, so excuse me if I'm not up to speed on much of the keyboard and keyboard-programming knowledge that many here at GH have. :/

Anyhoo - is this HID MACROS program still really the only usable tool we have if we want to program the same key on different keyboards/keypads to do different things (i.e. "Tab" on keyboard does one thing while "Tab" on a keypad does something else)?

I'm trying to figure out the best keypad/keyboard combination for my desk. I wanted to get a numeric keypad like the SCORPIUS 32 and program some of the buttons I don't use (like "Print Screen"). But yes, I don't want to "Print Screen" button on my keyboard to do the same thing - I want it to do something different! But I don't know if I could do this with the keyboards/keypads I choose and just software.

I haven't used AutoHotkey or really any program to remap keys. I've only remapped keys on my Kinesis ADVANTAGE so far using their built-in remapping abilities.

I fantasize about having just about the "right" # of buttons between all my desk's keyboards & keypads to easily navigate my way on my computer and not have to reach in weird spots and "hunt" for obscure symbols, buttons, etc. (really interrupts the "flow" and zen of punching cool keys and being efficient and effective on my computer). But I don't know if this fantasy is really viable with the tools currently out there - tools that should be usable by people not as savvy as programmers/hardcore geeks.

Offline flatlined

  • Posts: 5
How-To: Individual Hotkeys with multiple keyboards
« Reply #5 on: Mon, 09 January 2012, 15:30:26 »
Quote
is this HID MACROS program still really the only usable tool we have if we want to program the same key on different keyboards/keypads to do different things
there are a few hackish solutions, but they all suck.
however, i've found one alternative, quick macros. it's fairly easy to use, and does what it needs to. the downside? it costs about 40 bucks.

Offline dzd

  • Posts: 30
How-To: Individual Hotkeys with multiple keyboards
« Reply #6 on: Mon, 09 January 2012, 17:12:40 »
Great - thanks. Just wondering, have you used Quick Macros much already?

At least there's something out there. True, it'd be nice if it were cheaper/free, but $40 seems reasonable to not have to have wasted keys and/or add yet another programmable keypad just to get more "free" keys.

I searched the forums here, but it doesn't look like there's much discussion of QM. Guess it's best to check out QM's forums.