From 94e1881676e39bd8b8e6a8ee98e541102b380549 Mon Sep 17 00:00:00 2001 From: Henrique Alves Date: Sun, 28 Apr 2024 22:20:26 +0300 Subject: prototyping runtime code evaluation --- sources/core.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sources') diff --git a/sources/core.h b/sources/core.h index 70a7d81..3717a60 100644 --- a/sources/core.h +++ b/sources/core.h @@ -17,7 +17,13 @@ static s7_pointer rl_is_key_down(s7_scheme *s7, s7_pointer args) { return(s7_make_boolean(s7, isKey)); } +static s7_pointer rl_get_char_pressed(s7_scheme *s7, s7_pointer args) { + int key = GetCharPressed(); + return(s7_make_integer(s7, key)); +} + static void rl_core_define_methods(s7_scheme *s7) { s7_define_function(s7, "rl-is-key-down", rl_is_key_down, 1, 0, false, "(rl-is-key-down KEY)"); s7_define_function(s7, "rl-get-mouse-position", rl_get_mouse_position, 0, 0, false, "(rl-get-mouse-position)"); + s7_define_function(s7, "rl-get-char-pressed", rl_get_char_pressed, 0, 0, false, "(rl-get-char-pressed)"); } -- cgit v1.2.3