Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: dvorak support #88

Merged
merged 4 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,10 @@ We would welcome any PRs to add keyboard layouts.
Keyboard Contributors:

- [@delinx](https://github.com/delinx) [^1]
- [@tariks](https://github.com/tariks) [^2]

[^1]: colemak / colemak-dh
[^2]: Dvorak

## 💻 Supported Versions

Expand Down
3 changes: 2 additions & 1 deletion lua/hawtkeys/keyboards.lua
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
local M = {}
-- TODO: Make this dynamic, loading from the keyboards directory

---@alias HawtKeySupportedKeyboardLayouts "qwerty" | "colemak" | "colemak-dh"
---@alias HawtKeySupportedKeyboardLayouts "qwerty" | "colemak" | "colemak-dh" | "dvorak"

M.qwerty = require("hawtkeys.keyboards.qwerty").layout
M.colemak = require("hawtkeys.keyboards.colemak").layout
M.colemakdh = require("hawtkeys.keyboards.colemak-dh").layout
M.dvorak = require("hawtkeys.keyboards.dvorak").layout

return M
49 changes: 49 additions & 0 deletions lua/hawtkeys/keyboards/dvorak.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
local layout = {
["'"] = { finger = 1, row = 1, col = 1 },
[","] = { finger = 2, row = 1, col = 2 },
["."] = { finger = 3, row = 1, col = 3 },
p = { finger = 4, row = 1, col = 4 },
y = { finger = 4, row = 1, col = 5 },
f = { finger = 6, row = 1, col = 6 },
g = { finger = 6, row = 1, col = 7 },
c = { finger = 7, row = 1, col = 8 },
r = { finger = 8, row = 1, col = 9 },
l = { finger = 9, row = 1, col = 10 },
["/"] = { finger = 8, row = 1, col = 11 },
["="] = { finger = 9, row = 1, col = 12 },
-- ["\\"] = { finger = 9, row = 1, col = 13 },

a = { finger = 1, row = 2, col = 1 },
o = { finger = 2, row = 2, col = 2 },
e = { finger = 3, row = 2, col = 3 },
u = { finger = 4, row = 2, col = 4 },
i = { finger = 4, row = 2, col = 5 },
d = { finger = 6, row = 2, col = 6 },
h = { finger = 6, row = 2, col = 7 },
t = { finger = 7, row = 2, col = 8 },
n = { finger = 8, row = 2, col = 9 },
s = { finger = 9, row = 2, col = 10 },
["-"] = { finger = 9, row = 2, col = 11 },

[";"] = { finger = 2, row = 3, col = 1 },
q = { finger = 3, row = 3, col = 2 },
j = { finger = 4, row = 3, col = 3 },
k = { finger = 4, row = 3, col = 4 },
x = { finger = 4, row = 3, col = 5 },
b = { finger = 6, row = 3, col = 6 },
m = { finger = 6, row = 3, col = 8 },
w = { finger = 7, row = 3, col = 9 },
v = { finger = 8, row = 3, col = 10 },
z = { finger = 9, row = 3, col = 11 },

[" "] = { finger = 4, row = 4, col = 6 }, -- Spacebar
}

return {
layout = layout,
}

------1-2-3-4-5-6-7-8-9-0
---1- ' , . p y f g c r l / = \
---2- a o e u i d h t n -
---3- ; q j k x b m v z
Loading