Update RingRayLib - raylib.c - Add Function : bool IsKeyPressed(int key)
@@ -1040,6 +1040,20 @@ RING_FUNC(ring_OpenURL)
OpenURL(RING_API_GETSTRING(1));
}
+
+RING_FUNC(ring_IsKeyPressed)
+{
+ if ( RING_API_PARACOUNT != 1 ) {
+ RING_API_ERROR(RING_API_MISS1PARA);
+ return ;
+ }
+ if ( ! RING_API_ISNUMBER(1) ) {
+ RING_API_ERROR(RING_API_BADPARATYPE);
+ return ;
+ }
+ RING_API_RETNUMBER(IsKeyPressed( (int ) RING_API_GETNUMBER(1)));
+}
+
RING_API void ringlib_init(RingState *pRingState)
{
ring_vm_funcregister("initwindow",ring_InitWindow);
@@ -1120,4 +1134,5 @@ RING_API void ringlib_init(RingState *pRingState)
ring_vm_funcregister("storagesavevalue",ring_StorageSaveValue);
ring_vm_funcregister("storageloadvalue",ring_StorageLoadValue);
ring_vm_funcregister("openurl",ring_OpenURL);
+ ring_vm_funcregister("iskeypressed",ring_IsKeyPressed);
}
