indexzero / indexzero/dotfiles
Use hammerspoon to rebind numeric keypad
Open
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
-- Function to remap numpad keys to top-row keys
function remapNumpadToTopRow(padKey, topKey)
-- Bind the numpad key with all possible modifiers
hs.hotkey.bind({"cmd", "alt", "ctrl", "shift"}, padKey, function()
-- Simulate pressing the top-row key with the *actual* currently pressed modifiers
local mods = hs.eventtap.checkMouseKeys() -- A helper to get current modifiers
hs.eventtap.keyStroke(mods, topKey)
end)
end
-- Apply this function for each number 1-9 and 0
remapNumpadToTopRow("pad0", "0")
remapNumpadToTopRow("pad1", "1")
remapNumpadToTopRow("pad2", "2")
remapNumpadToTopRow("pad3", "3")
remapNumpadToTopRow("pad4", "4")
remapNumpadToTopRow("pad5", "5")
remapNumpadToTopRow("pad6", "6")
remapNumpadToTopRow("pad7", "7")
remapNumpadToTopRow("pad8", "8")
remapNumpadToTopRow("pad9", "9")
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the repository's Hammerspoon or Lua configuration, since no target file is named. Compare the existing setup with the provided keypad-to-top-row mapping and verify that numeric keypad keys work with the intended modifiers; done means the mappings are integrated and usable.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- lua
- Domain
- desktop
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100