/* LICENSE BEGIN This file is part of the SixtyFPS Project -- https://sixtyfps.io Copyright (c) 2021 Olivier Goffart Copyright (c) 2021 Simon Hausmann SPDX-License-Identifier: GPL-3.0-only This file is also available under commercial licensing terms. Please contact info@sixtyfps.io for more information. LICENSE END */ W := Window { VerticalLayout { Rectangle { background: field.has_focus ? blue: red; } field := FocusScope { vertical_stretch: 1; key-pressed(event) => { if (event.modifiers.control) { debug(" (control modifier pressed)"); } if (event.modifiers.alt) { debug(" (alt modifier pressed)"); } if (event.modifiers.shift) { debug(" (shift modifier pressed)"); } if (event.modifiers.meta) { debug(" (meta modifier pressed)"); } debug(event.text); t.text += event.text; accept } Rectangle { background: yellow; } } t:= Text { text: "> "; } } }