

If (button = 102 and key18 = 1 and key99 = 1) then withAlt(function() withCtrl(function() press('A') end) end) print(' If (button = 102) then key102 = direction end If (button = 100) then key100 = direction end If (button = 99) then key99 = direction end If (button = 98) then key98 = direction end If (button = 97) then key97 = direction end If (button = 96) then key96 = direction end If (button = 18) then key18 = direction end Lmc_set_handler('MACROS',function(button,direction,ts,flags,makecode) (Or download the file from here.) - UGS Pendant Everybody knows Lua, right?!ĭon't worry, I've done most of the heavy lifting already, and you can download my scripts in the sections below.Ĭopy the code below into LuaMacros. Unfortunately, you need to write Lua script. The program will understand whether the numlock on the keypad is on, whether the fn key is being pressed, etc. You could even hook up several keypads and have separate macros for each. With this program, you can capture keystrokes from a particular device like the USB keypad and ignore all keys from other devices, like your main keyboard. So what I did was use the program LuaMacros to intercept the keys from the USB keypad and map them to CTRL+ALT+, which are likely not assigned to anything else and unlikely that you're going to accidentally hit them. But the keys are common keys, like '5', that you may hit all the time, when you actually want to type a '5' and not move your y-axis, for example. So theoretically you could just hook up the USB keypad and then map the keys in UGS to whatever functions you wanted.

Assuming you have this keypad, hook it up to your computer. You can do this with any keypad, but the images that I've created and the scripts are specific to the keypad in the Supplies section. It should be everything you need to get up and running with minimal effort. Here, I'll detail how I made my pendant, including the hardware, software, keymapping for UGS, and artwork.

Also, I use my machine a bit differently, so I updated the keys to follow my use case more closely. So I switched to a wired USB keyboard that would always be on.

And because it was wireless, I couldn't figure out how to keep it from going to sleep. Specifically, the program that maps keys from the keypad to the keystrokes to send to UGS had trouble reconnecting to the keypad after it went to sleep. It was a great start, but I had a couple issues with the Jelly Comb numeric keypad that he used. Originally, I found the Instructable by mr.incredible here: Wireless-UGS-Pendant. without having to use the main keyboard or mouse. UGS has the ability to map keys to various actions, and this gives rise to the ability to have a wired or wireless "pendant" that I can use to move the machine around, run macros, etc. I have a New Carve 1000 from CNC4Newbie and I use Universal Gcode Sender (UGS) to send my g-code to my controller.
