{"id":6922,"date":"2021-06-02T17:37:56","date_gmt":"2021-06-02T17:37:56","guid":{"rendered":"https:\/\/max-drake.cc\/?p=6922"},"modified":"2021-06-02T17:37:59","modified_gmt":"2021-06-02T17:37:59","slug":"mapping-a-2nd-keyboard-for-macros-usb-bluetooth","status":"publish","type":"post","link":"https:\/\/max-drake.cc\/?p=6922","title":{"rendered":"Mapping a 2nd Keyboard for macros (USB &#038; bluetooth)"},"content":{"rendered":"\n<p>After playing with AHK scripts I ended with a lot of scripts and nothing to map them to as the easily memorised and handy left keys that my hand can access are all used up. <\/p>\n\n\n\n<p>I ended with AHK Command Picker and that has alleviated some of the stress of having macro&#8217;s handy, but it only goes so far. You have to tap CapsLock key then type the Fastkey that you want, a lot of mine have filled up the obvious ones so now I&#8217;m having 2 digit for easily finding the ones I want, so I have to tap 3 keys now to get to what I want.<\/p>\n\n\n\n\n\n<p>A couple of videos I&#8217;ve seen for Gamers who use a 2nd keyboard for macro&#8217;s usually a little numberpad and have macros attached to those keys. So I thought I&#8217;d explore that process. I&#8217;m using <a href=\"https:\/\/github.com\/evilC\">evilC<\/a> \/ <strong><a href=\"https:\/\/github.com\/evilC\/AutoHotInterception\">AutoHotInterception<\/a><\/strong> process to do this. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Other processes<\/h4>\n\n\n\n<p>There are a few programs out there, one HID Macros (This video https:\/\/www.youtube.com\/watch?v=Oqmt6zUvCVw) and this link <a rel=\"noreferrer noopener\" href=\"https:\/\/www.youtube.com\/redirect?event=video_description&amp;redir_token=QUFFLUhqbl8wSThEd0RSd0lnSFdoT1l5aC04Sjllcmtrd3xBQ3Jtc0tuSUkyZU9lNGRlYllESW9YUW1VbkN0NUJXQ3ZMcXFTX2NXQW8tcmhmQV9KbG8ySE5qcXUxTjEwNGpEaTY5RWxRZ3pVQjVVT1F3RmJaOE9uZ2RaNWltMS0xUFZMNVVfTXlhOWNOYUNySkxkNTI3MVNVUQ&amp;q=http%3A%2F%2Fwww.hidmacros.eu\" target=\"_blank\">http:\/\/www.hidmacros.eu<\/a> but what you download is different form what the website says. Apparently its old. <\/p>\n\n\n\n<p>Another was Multi-keyboard-Macro&#8217;s for $29 (https:\/\/mediachance.com\/multikeyboard\/)- But not free so I thought I&#8217;d try other ways first. <\/p>\n\n\n\n<p>Another was Multi-keyboard-remapper (<strong><span style=\"background-color:#cf2e2e\" class=\"background-color\">don&#8217;t download from this site (Trojans)<\/span><\/strong>-https:\/\/steveh2112.wixsite.com\/multi-keyboard-remap) but you can from Sonic or other download sites and it seems OK. But no clear instructions on how to re-map hotkeys, so I left it. <\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Setup<\/h4>\n\n\n\n<p>I cocked up the instruction from the evilC site but finally figured out what to do. The instructions are there, its just I was copying wrong files from wrong zip file (make sure you unblock prior to extracting. <\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Keyboards and mouses<\/h3>\n\n\n\n<p>I&#8217;ve been playing with gaming mouses. KMart were selling 7 button gaming mice for $16 so I thought I&#8217;d give them a try. I&#8217;ve got use to bluetooth mice but thought, as I&#8217;m on a Surface Book with a couple of USB ports, I could afford to try the USB option again and I&#8217;ve been enjoying adding extra features to the mouse, although I promptly forget what I&#8217;d mapped to the new buttons. I&#8217;m still trying to figure that out. <\/p>\n\n\n\n<p>I&#8217;d considered using a 2nd keypad as that would be handy for developing AHK scripts for Revit and other programs. <\/p>\n\n\n\n<p>I&#8217;d initially thought about getting a number keypad to practice on but realised that I had a 2nd keyboard (for my planned server) and also used for Raspberry Pi too. Both I&#8217;ve tinkered with but not that far. I also had a Surface book screen with no keyboard and found a bluetooth keyboard for it, it works fine. This is the issue with Surface Book, when Keyboard goes you can only connect to it by wifi as there are no ports in the tablet part, and charger is on the bottom, not the best design for redundancy. <\/p>\n\n\n\n<p>Anyway, I have a wired &amp; a bluetooth keyboard and wanted to see if <a href=\"https:\/\/github.com\/evilC\">evilC<\/a> \/ <strong><a href=\"https:\/\/github.com\/evilC\/AutoHotInterception\">AutoHotInterception<\/a><\/strong> would work on them. <\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img decoding=\"async\" width=\"640\" height=\"480\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/06\/IMG20210603135325.jpg\" alt=\"\" class=\"wp-image-6924 lazyload\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/06\/IMG20210603135325.jpg 640w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/06\/IMG20210603135325-300x225.jpg 300w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/06\/IMG20210603135325-50x38.jpg 50w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/06\/IMG20210603135325-67x50.jpg 67w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/06\/IMG20210603135325-100x75.jpg 100w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/06\/IMG20210603135325-133x100.jpg 133w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/06\/IMG20210603135325-1024x768.jpg 1024w\" data-sizes=\"(max-width: 640px) 100vw, 640px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 640px; --smush-placeholder-aspect-ratio: 640\/480;\" \/><\/figure>\n\n\n\n<p>It does. You use the monitor.ahk script which will go and find what devices you have attached, so you can test them and coy the VID\/PID or the Handle depending on the device (see below) :<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img decoding=\"async\" width=\"1024\" height=\"367\" data-src=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/06\/2021-06-03-15_26_23-Monitor.ahk-AutoHotInterception-Visual-Studio-Code-1024x367.jpg\" alt=\"\" class=\"wp-image-6926 lazyload\" data-srcset=\"https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/06\/2021-06-03-15_26_23-Monitor.ahk-AutoHotInterception-Visual-Studio-Code-1024x367.jpg 1024w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/06\/2021-06-03-15_26_23-Monitor.ahk-AutoHotInterception-Visual-Studio-Code-300x107.jpg 300w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/06\/2021-06-03-15_26_23-Monitor.ahk-AutoHotInterception-Visual-Studio-Code-768x275.jpg 768w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/06\/2021-06-03-15_26_23-Monitor.ahk-AutoHotInterception-Visual-Studio-Code-1536x550.jpg 1536w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/06\/2021-06-03-15_26_23-Monitor.ahk-AutoHotInterception-Visual-Studio-Code-50x18.jpg 50w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/06\/2021-06-03-15_26_23-Monitor.ahk-AutoHotInterception-Visual-Studio-Code-140x50.jpg 140w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/06\/2021-06-03-15_26_23-Monitor.ahk-AutoHotInterception-Visual-Studio-Code-100x36.jpg 100w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/06\/2021-06-03-15_26_23-Monitor.ahk-AutoHotInterception-Visual-Studio-Code-279x100.jpg 279w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/06\/2021-06-03-15_26_23-Monitor.ahk-AutoHotInterception-Visual-Studio-Code-1788x640.jpg 1788w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/06\/2021-06-03-15_26_23-Monitor.ahk-AutoHotInterception-Visual-Studio-Code-640x229.jpg 640w, https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/06\/2021-06-03-15_26_23-Monitor.ahk-AutoHotInterception-Visual-Studio-Code-scaled.jpg 1600w\" data-sizes=\"(max-width: 1024px) 100vw, 1024px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1024px; --smush-placeholder-aspect-ratio: 1024\/367;\" \/><\/figure>\n\n\n\n<p>For the wired keyboard you need to use  (AHI.GetKeyboardId())<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#SingleInstance force\n#Persistent\n#include Lib\\AutoHotInterception.ahk\n\nAHI := new AutoHotInterception()\n\nkeyboardId := AHI.GetKeyboardId(0x04D9, 0x1503)\nAHI.SubscribeKey(keyboardId, GetKeySC(\"1\"), true, Func(\"KeyEvent\"))\nreturn<\/code><\/pre>\n\n\n\n<p>For the wireless keyboard you need to use (AHI.GetKeyboardIdFromHandle()), and in that case the &#8220;\\&#8221; causes trouble so you have to put the whole handle in &#8220;&#8221; quotes and then assign a variable to it, then call the variable<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#SingleInstance force\n#Persistent\n#include Lib\\AutoHotInterception.ahk\n\nAHI := new AutoHotInterception()\nax:= \"HID\\{00001124-0000-1000-8000-00805f9b34fb}_VID&amp;000205ac_PID&amp;0220&amp;Col01\"\nkeyboardId := AHI.GetKeyboardIdFromHandle(ax)\nAHI.SubscribeKeyboard(keyboardId, true, Func(\"KeyEvent\"))\n\nreturn<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">End comment<\/h3>\n\n\n\n<p>So I&#8217;ve now been able to connect a couple of Keyboards to my Laptop and run a scrip<\/p>\n\n\n\n<p>t from the key from the 2nd keyboard. That is great. Now I can start thinking about how I&#8217;ll set that up and use it and in what programs I&#8217;d use it in. <\/p>\n\n\n\n<p>I can see some keys being useful for Firefox tabbing (although there may be a more efficient Hotkey method for that) as I&#8217;m not particularly productive in web browsers and need to be more effective in future. <\/p>\n\n\n\n<p>I will write another article when I&#8217;ve got some macro&#8217;s up and running. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>After playing with AHK scripts I ended with a lot of scripts and nothing to map them to as the easily memorised and handy left keys that my hand can access are all used up. I ended with AHK Command Picker and that has alleviated some of the stress of having macro&#8217;s handy, but it [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6924,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[204],"tags":[],"class_list":["post-6922","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-automation"],"featured_image_src":"https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/06\/IMG20210603135325-600x400.jpg","featured_image_src_square":"https:\/\/max-drake.cc\/wp-content\/uploads\/2021\/06\/IMG20210603135325-600x600.jpg","author_info":{"display_name":"Max Drake","author_link":"https:\/\/max-drake.cc\/?author=1"},"_links":{"self":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/6922","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6922"}],"version-history":[{"count":0,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/posts\/6922\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=\/wp\/v2\/media\/6924"}],"wp:attachment":[{"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6922"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6922"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/max-drake.cc\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6922"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}