done adding functional-core part of arrow input (now just need to adjust a bit in the imperative shell next)

This commit is contained in:
2024-09-20 14:14:07 +01:00
parent 9ffc19ef24
commit 3472ff3c1c
2 changed files with 11 additions and 0 deletions

View File

@@ -184,6 +184,11 @@ struct
SOME (hIdx, vIdx) => addCoordinates (model, hIdx, vIdx)
| NONE => (model, NO_MAILBOX)
fun enterOrSpaceCoordinates model =
let val {arrowX, arrowY, ...} = model
in addCoordinates (model, arrowX, arrowY)
end
fun resizeWindow (model, width, height) =
let
val model = AppWith.windowResize (model, width, height)
@@ -366,6 +371,8 @@ struct
| ARROW_LEFT => moveArrowLeft model
| ARROW_RIGHT => moveArrowRight model
| ARROW_DOWN => moveArrowDown model
| KEY_ENTER => enterOrSpaceCoordinates model
| KEY_SPACE => enterOrSpaceCoordinates model
| USE_TRIANGLES triangles => useTriangles (model, triangles)
| TRIANGLES_LOAD_ERROR => trianglesLoadError model
end

View File

@@ -15,6 +15,8 @@ sig
| ARROW_LEFT
| ARROW_RIGHT
| ARROW_DOWN
| KEY_ENTER
| KEY_SPACE
| USE_TRIANGLES of AppType.triangle list
| TRIANGLES_LOAD_ERROR
end
@@ -36,6 +38,8 @@ struct
| ARROW_LEFT
| ARROW_RIGHT
| ARROW_DOWN
| KEY_ENTER
| KEY_SPACE
| USE_TRIANGLES of AppType.triangle list
| TRIANGLES_LOAD_ERROR
end