add function to convert string to CoreKey.key_code (for parsing/loading controls from files)

This commit is contained in:
2025-02-17 01:39:41 +00:00
parent 291ee2f7f2
commit 99669dd0b6
4 changed files with 131 additions and 1 deletions

View File

@@ -30,7 +30,9 @@ struct
, jumpHeld = !(#jumpHeld state)
}
fun actionToBool action = action = Input.PRESS
(* there are three action states reported by OS: PRESS, REPEAT and RELEASE.
* If input is PRESS or REPEAT, then return true, or else return false. *)
fun actionToBool action = action <> Input.RELEASE
fun handleKey (key, action) =
case GlfwKeyMap.codeFromKey key of

1
shell/parse-controls.sml Normal file
View File

@@ -0,0 +1 @@
structure ParseControls = struct end