summaryrefslogtreecommitdiff
path: root/src/keys.nim
diff options
context:
space:
mode:
authorkitty piapiac <kcp@bsd.computer>2020-07-30 11:01:46 -0700
committerkitty piapiac <kcp@bsd.computer>2020-07-30 11:01:46 -0700
commita87e3460be918b491878b151991ece4e5246819e (patch)
tree2573757889ffef83b434ad1668bc20f7dc49b92e /src/keys.nim
parentb1745b4d2e449e07aa2b08a9def6894ec6d0fe53 (diff)
λ rework handling key events
Diffstat (limited to 'src/keys.nim')
-rw-r--r--src/keys.nim18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/keys.nim b/src/keys.nim
new file mode 100644
index 0000000..bfe79aa
--- /dev/null
+++ b/src/keys.nim
@@ -0,0 +1,18 @@
+type
+ KeyFunc* = enum
+ closeWindow,
+ nextWindow,
+ spawnCustom
+
+ Key* = object
+ mods*: cuint
+ key*: string
+ keyfunc*: KeyFunc
+ command*: string
+
+proc initKey* (keyfunc: KeyFunc, mods: cuint, key: string, command = ""): Key =
+ return Key(
+ mods: mods,
+ key: key,
+ command: command,
+ keyfunc: keyfunc) \ No newline at end of file