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:
@@ -184,6 +184,11 @@ struct
|
|||||||
SOME (hIdx, vIdx) => addCoordinates (model, hIdx, vIdx)
|
SOME (hIdx, vIdx) => addCoordinates (model, hIdx, vIdx)
|
||||||
| NONE => (model, NO_MAILBOX)
|
| NONE => (model, NO_MAILBOX)
|
||||||
|
|
||||||
|
fun enterOrSpaceCoordinates model =
|
||||||
|
let val {arrowX, arrowY, ...} = model
|
||||||
|
in addCoordinates (model, arrowX, arrowY)
|
||||||
|
end
|
||||||
|
|
||||||
fun resizeWindow (model, width, height) =
|
fun resizeWindow (model, width, height) =
|
||||||
let
|
let
|
||||||
val model = AppWith.windowResize (model, width, height)
|
val model = AppWith.windowResize (model, width, height)
|
||||||
@@ -366,6 +371,8 @@ struct
|
|||||||
| ARROW_LEFT => moveArrowLeft model
|
| ARROW_LEFT => moveArrowLeft model
|
||||||
| ARROW_RIGHT => moveArrowRight model
|
| ARROW_RIGHT => moveArrowRight model
|
||||||
| ARROW_DOWN => moveArrowDown model
|
| ARROW_DOWN => moveArrowDown model
|
||||||
|
| KEY_ENTER => enterOrSpaceCoordinates model
|
||||||
|
| KEY_SPACE => enterOrSpaceCoordinates model
|
||||||
| USE_TRIANGLES triangles => useTriangles (model, triangles)
|
| USE_TRIANGLES triangles => useTriangles (model, triangles)
|
||||||
| TRIANGLES_LOAD_ERROR => trianglesLoadError model
|
| TRIANGLES_LOAD_ERROR => trianglesLoadError model
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -15,6 +15,8 @@ sig
|
|||||||
| ARROW_LEFT
|
| ARROW_LEFT
|
||||||
| ARROW_RIGHT
|
| ARROW_RIGHT
|
||||||
| ARROW_DOWN
|
| ARROW_DOWN
|
||||||
|
| KEY_ENTER
|
||||||
|
| KEY_SPACE
|
||||||
| USE_TRIANGLES of AppType.triangle list
|
| USE_TRIANGLES of AppType.triangle list
|
||||||
| TRIANGLES_LOAD_ERROR
|
| TRIANGLES_LOAD_ERROR
|
||||||
end
|
end
|
||||||
@@ -36,6 +38,8 @@ struct
|
|||||||
| ARROW_LEFT
|
| ARROW_LEFT
|
||||||
| ARROW_RIGHT
|
| ARROW_RIGHT
|
||||||
| ARROW_DOWN
|
| ARROW_DOWN
|
||||||
|
| KEY_ENTER
|
||||||
|
| KEY_SPACE
|
||||||
| USE_TRIANGLES of AppType.triangle list
|
| USE_TRIANGLES of AppType.triangle list
|
||||||
| TRIANGLES_LOAD_ERROR
|
| TRIANGLES_LOAD_ERROR
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user