// Copyright © SixtyFPS GmbH // SPDX-License-Identifier: MIT export component FocusTouchArea { in property enabled: true; out property has-focus <=> focus-scope.has-focus; out property pressed <=> touch-area.pressed; out property has-hover <=> touch-area.has-hover; out property enter-pressed; in property mouse-cursor <=> touch-area.mouse-cursor; callback clicked <=> touch-area.clicked; forward-focus: focus-scope; focus-scope := FocusScope { x: 0; width: 0px; enabled: root.enabled; key-pressed(event) => { if !root.enabled { return reject; } if (event.text == " " || event.text == "\n") && !root.enter-pressed { root.enter-pressed = true; touch-area.clicked(); return accept; } reject } key-released(event) => { if !root.enabled { return reject; } if (event.text == " " || event.text == "\n") && root.enter-pressed { root.enter-pressed = false; return accept; } reject } } touch-area := TouchArea { enabled: root.enabled; } }