diff --git a/dotscape b/dotscape index 21000d6..6e9b61f 100755 Binary files a/dotscape and b/dotscape differ diff --git a/fcore/normal-mode.sml b/fcore/normal-mode.sml index 9fbb1b1..917f7a7 100644 --- a/fcore/normal-mode.sml +++ b/fcore/normal-mode.sml @@ -252,8 +252,9 @@ struct fun updateBlue model = (AppWith.b model, []) fun updateAlpha model = (AppWith.a model, []) - fun updateCanvasWidth (model, newCanvasWidth) = + fun updateCanvasWidth model = let + val newCanvasWidth = #modalNum model val model = AppWith.canvasWidth (model, newCanvasWidth) val @@ -322,7 +323,7 @@ struct | KEY_G => updateGreen model | KEY_B => updateBlue model | KEY_A => updateAlpha model - | KEY_W newCanvasWidth => updateCanvasWidth (model, newCanvasWidth) + | KEY_W => updateCanvasWidth model | RESIZE_WINDOW {width, height} => resizeWindow (model, width, height) | UNDO_ACTION => undoAction model | REDO_ACTION => redoAction model diff --git a/ffi/glfw-input.c b/ffi/glfw-input.c index ace6a3a..89acd59 100644 --- a/ffi/glfw-input.c +++ b/ffi/glfw-input.c @@ -20,6 +20,7 @@ int KEY_I = GLFW_KEY_I; int KEY_L = GLFW_KEY_L; int KEY_O = GLFW_KEY_O; int KEY_A = GLFW_KEY_A; +int KEY_W = GLFW_KEY_W; int KEY_ENTER = GLFW_KEY_ENTER; int KEY_SPACE = GLFW_KEY_SPACE; diff --git a/ffi/glfw-input.sml b/ffi/glfw-input.sml index 78b7b3d..84eed39 100644 --- a/ffi/glfw-input.sml +++ b/ffi/glfw-input.sml @@ -57,6 +57,8 @@ struct _symbol "KEY_O" public : ( unit -> int ) * ( int -> unit ); val (KEY_A, _) = _symbol "KEY_A" public : ( unit -> int ) * ( int -> unit ); + val (KEY_W, _) = + _symbol "KEY_W" public : ( unit -> int ) * ( int -> unit ); val (KEY_ENTER, _) = _symbol "KEY_ENTER" public : ( unit -> int ) * ( int -> unit ); diff --git a/imperative-shell/input-callbacks.sml b/imperative-shell/input-callbacks.sml index 0703a15..3c4a51a 100644 --- a/imperative-shell/input-callbacks.sml +++ b/imperative-shell/input-callbacks.sml @@ -72,6 +72,10 @@ struct key = Input.KEY_A () andalso action = Input.PRESS () andalso mods = 0 then Mailbox.send (mailbox, KEY_A) + else if + key = Input.KEY_W () andalso action = Input.PRESS () andalso mods = 0 + then + Mailbox.send (mailbox, KEY_W) else if key = Input.KEY_UP () andalso action <> Input.RELEASE () andalso mods = 0x0 diff --git a/message-types/input-msg.sml b/message-types/input-msg.sml index 283b710..9e859f6 100644 --- a/message-types/input-msg.sml +++ b/message-types/input-msg.sml @@ -12,7 +12,7 @@ struct | KEY_B | KEY_T | KEY_A - | KEY_W of int + | KEY_W | KEY_CTRL_S | KEY_CTRL_L | KEY_CTRL_E