From c4241b7cc97e9b0a341d54f2a4d172500c1d5399 Mon Sep 17 00:00:00 2001 From: sanine Date: Mon, 3 Oct 2022 21:12:22 -0500 Subject: add window.getKey --- demo/bouncing_ball/main.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'demo/bouncing_ball') diff --git a/demo/bouncing_ball/main.lua b/demo/bouncing_ball/main.lua index ecbff7b..f98a032 100644 --- a/demo/bouncing_ball/main.lua +++ b/demo/bouncing_ball/main.lua @@ -98,6 +98,10 @@ local dtAverage = 0 local dtCount = 0 while not window.shouldClose(w) do + if window.getKey(w, window.KEY_ESCAPE) == window.PRESS then + break + end + local newTime = window.getTime() local dt = newTime - time dtAverage = dtAverage + dt -- cgit v1.2.1