This commit is contained in:
Simon Cruanes 2020-03-11 14:37:24 -05:00 committed by Frédéric Bour
parent bd1ba94339
commit 57c3cee786
2 changed files with 4 additions and 2 deletions

View File

@ -294,6 +294,8 @@ let edit_field state ~on_change ~on_submit =
[I.string A.empty (if text = "" then " " else text)]
in
let handler = function
| `ASCII 'U', [`Ctrl] -> on_change ("", 0); `Handled (* clear *)
| `Escape, [] -> Focus.release focus; `Handled
| `ASCII k, _ ->
let text =
if pos < String.length text then (

View File

@ -615,10 +615,10 @@ struct
match t.desc with
| Atom _ | Overlay _ -> acc
| X (a, b) | Y (a, b) | Z (a, b) ->
(* Default to left/top-most branch if there is no focus *)
(* Try left/top most branch first *)
if Focus.has_focus b.focus
then dispatch_key_branch acc b
else dispatch_key_branch acc a
else dispatch_key_branch (dispatch_key_branch acc b) a
| Focus_area (t, f) -> dispatch_key_branch (f :: acc) t
| Mouse_handler (t, _) | Size_sensor (t, _)
| Scroll_area (t, _, _) | Resize (t, _, _) ->