A Hammerspoon spoon to use your numpad as a macro pad for emoji and text snippets. It's meant to help with responding quickly in chat during livestreams.
Assigning emoji to numpad keys:
Another layer of text/emoji with a custom modifier key (0
in this case) and auto-pressing return:
Assigning a list of text/emoji strings to one key, emitting a random one (but never the same twice in a row:
Install Hammerspoon as per the instructions in the Setup section on the Hammerspoon website.
Then download the the Spoon, unzip and double-click to install.
In your init.lua
(click Hammerspoon's menubar icon, Open Config), load the spoon like this:
hs.loadSpoon("NumMacroPad")
You need to configure keys individually. Numpad keys that work are:
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "+", "-", "*", "/", "enter"
The ,
and numlock keys are not supported at this point.
It's possible to use one numpad key as a modifier key. If the modifier is held when pressing another numpad key, a different (configured) text is sent than without the modifier key, similar to an Alt key.
To use 0
as the modifier key, add:
spoon.NumMacroPad:key_layer_shift("0")
Config for the actual keys looks like this:
spoon.NumMacroPad:key_message("+",
"π",
"thanks! π<enter>"
)
This says: Key +
emits "π"" when pressed without the modifier (or if no modifier is defined).
With the modifier key held down, it emits "thanks! π" and the return key is (virtually) pressed,
which would send the message in most chat clients.
You can also specify a list of text snippets (with or without <enter>
); if such a list is given,
the spoon will pick a random text and emit that (but never the same one twice in a row). This would
look like this:
spoon.NumMacroPad:key_message("+",
"π",
{
"thanks! π<enter>",
"thank you! π<enter>",
"thanks! πππ<enter>",
"thank you!<enter>",
"πππ<enter>"
}
)
You'll have to do this for each key. If you do not specify one key, it keeps it's default function,
i.e. if you don't reconfigure enter
, it'll work as an enter key.
A complete config is shown below. This will emit emoji like the emoji touchbar or the macOS
emoji picker, and three consecutive emoji with an enter keypress if 0
is held down. +
acts as a
special thank-you key and will send a random thank-you message if pressed while the modifier 0
is
held down.
hs.loadSpoon("NumMacroPad")
spoon.NumMacroPad:key_layer_shift( "0" )
spoon.NumMacroPad:key_message( "1",
"π³",
"π³π³π³<enter>"
)
spoon.NumMacroPad:key_message( "2",
"π₯³",
"π₯³π₯³π₯³<enter>"
)
spoon.NumMacroPad:key_message( "3",
"π",
"πππ<enter>"
)
spoon.NumMacroPad:key_message( "4",
"π",
"πππ<enter>"
)
spoon.NumMacroPad:key_message( "5",
"π€",
"π€π€π€<enter>"
)
spoon.NumMacroPad:key_message( "6",
"π",
"πβ€οΈπ<enter>"
)
spoon.NumMacroPad:key_message( "7",
"π",
"π π π<enter>"
)
spoon.NumMacroPad:key_message( "8",
"π",
"πππ<enter>"
)
spoon.NumMacroPad:key_message( "9",
"π₯",
"π₯π₯π₯<enter>"
)
spoon.NumMacroPad:key_message( "/",
"π―",
"π―<enter>"
)
spoon.NumMacroPad:key_message( "-",
"π’",
"π’π’π’<enter>"
)
spoon.NumMacroPad:key_message( "*",
"π₯Ί",
"π₯Ίπ₯Ίπ₯Ί<enter>"
)
spoon.NumMacroPad:key_message( "enter",
"π¦",
"π¦π¦π¦<enter>"
)
spoon.NumMacroPad:key_message( "+",
"π",
{
"thanks! π<enter>",
"thank you! π<enter>",
"thanks! πππ<enter>",
"thank you!<enter>",
"πππ<enter>"
}
)
Once you're done, click Hammerspoon's menubar icon again and select Reload config.