summaryrefslogtreecommitdiff
path: root/src/client/cursor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/cursor.cpp')
-rw-r--r--src/client/cursor.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/client/cursor.cpp b/src/client/cursor.cpp
new file mode 100644
index 0000000..4e76151
--- /dev/null
+++ b/src/client/cursor.cpp
@@ -0,0 +1,13 @@
+struct Cursor {
+ int x;
+ int y;
+ Window *w;
+
+ void move_left() {
+ if (x > 0) x--;
+ }
+
+ void move_right() {
+ if (x < w->width - 1 && w->pos(x + 1, y) != 0) x++;
+ }
+};