From ce7e819e40265f68560c3a6cf309d259c2a77910 Mon Sep 17 00:00:00 2001 From: Javier Sancho Date: Sat, 23 May 2020 08:33:44 +0200 Subject: [PATCH] get-event-key get-event-key-pressed --- examples/04-movement.scm | 4 ++-- irrlicht.scm | 2 ++ irrlicht/irr.scm | 10 +++++++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/examples/04-movement.scm b/examples/04-movement.scm index 8d63a73..79f12c5 100644 --- a/examples/04-movement.scm +++ b/examples/04-movement.scm @@ -57,8 +57,8 @@ (if (equal? (get-event-type event) 'key-input-event) (set! key-is-down (assoc-set! key-is-down - (get-event-key-input-key event) - (get-event-key-input-pressed event)))) + (get-event-key event) + (get-event-key-pressed event)))) #f) (define receiver (make-event-receiver on-event)) diff --git a/irrlicht.scm b/irrlicht.scm index b10c4fb..80662cf 100644 --- a/irrlicht.scm +++ b/irrlicht.scm @@ -80,6 +80,8 @@ end-scene get-absolute-transformation get-cursor-control + get-event-key + get-event-key-pressed get-event-type get-file-system get-fps diff --git a/irrlicht/irr.scm b/irrlicht/irr.scm index 0f9180f..037b459 100644 --- a/irrlicht/irr.scm +++ b/irrlicht/irr.scm @@ -39,11 +39,19 @@ (define-class () (irr-class #:init-value "SEvent")) +(define-method (get-event-key (event )) + (let ((SEvent_SKeyInput_Key (get-irrlicht-proc "SKeyInput_Key" event))) + (SEvent_SKeyInput_Key event))) + +(define-method (get-event-key-pressed (event )) + (let ((SEvent_SKeyInput_PressedDown (get-irrlicht-proc "SKeyInput_PressedDown" event))) + (SEvent_SKeyInput_PressedDown event))) + (define-method (get-event-type (event )) (let ((SEvent_EventType (get-irrlicht-proc "EventType" event))) (SEvent_EventType event))) -(export get-event-type) +(export get-event-key get-event-key-pressed get-event-type) ;; IEventReceiver -- 2.39.5