From 8c2c6e551ac85aa22d0b7b073360637fa82bc654 Mon Sep 17 00:00:00 2001 From: "sigonasr2, Sig, Sigo" Date: Thu, 1 Jun 2023 20:45:39 +0000 Subject: [PATCH] Keyboard functionality Co-authored-by: sigonasr2 --- main.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/main.cpp b/main.cpp index bef729f..99887fe 100644 --- a/main.cpp +++ b/main.cpp @@ -96,7 +96,10 @@ public: return true; } - void GetAnyKeyPress(olc::Key pressed)override{ + void GetAnyKeyPress(olc::Key k)override{ + if (k>=A&&k<=Z){ + document[cursors[0].line].insert(cursors[0].pos,std::string(1,Z-k)); + } } };