Implement basic focus handling

Similar to the mouse_grabber, we use a VisitChildrenResult field to
track the focus item within a component. Unlike the mouse grabber
however, it is set/cleared using dedicated focus events.

The key event now routes the key event directly to the focus item.

The focus can be requested via set_focus_item on a window, which the
TextItem does.
This commit is contained in:
Simon Hausmann 2020-09-24 08:50:32 +02:00
parent aa5babffe1
commit e5dfb3a4c0
19 changed files with 603 additions and 48 deletions

View file

@ -27,7 +27,8 @@ require.extensions['.60'] =
let comp = c.create(init_properties);
let ret = {
show() { comp.show() },
send_mouse_click(x, y) { comp.send_mouse_click(x, y) }
send_mouse_click(x, y) { comp.send_mouse_click(x, y) },
send_keyboard_string_sequence(s) { comp.send_keyboard_string_sequence(s) }
};
c.properties().forEach(x => {
Object.defineProperty(ret, x, {