Skip to content

Commit

Permalink
Initial keyboard typing support
Browse files Browse the repository at this point in the history
Still needs fixes like arrow keys not working
Also need to figure out when to send hold input and when ascii event
  • Loading branch information
Willy-JL committed Oct 29, 2024
1 parent dd6082a commit 2237db2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
7 changes: 6 additions & 1 deletion application/components/DirectionalKeypad.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ Item {
id: control

signal inputEvent(var key, var type)
signal asciiEvent(var value)

property int spacing: 15

Expand Down Expand Up @@ -159,14 +160,18 @@ Item {

const button = findButton(event.key);

if(button === null)
if(button === null) {
// Temporary until better logic is in place
asciiEvent(event.text.charCodeAt(0));
return;
}

button.setReleased();
event.accepted = true;
}

function findButton(key) {
return null; // Temporary until better logic is in place
switch(key) {
case Qt.Key_Left:
case Qt.Key_H:
Expand Down
4 changes: 4 additions & 0 deletions application/components/StreamOverlay.qml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ AbstractOverlay {
Backend.screenStreamer.sendInputEvent(key, type);
}

onAsciiEvent: function(value) {
Backend.screenStreamer.sendAsciiEvent(value);
}

// Prevent focus loss
onEnabledChanged: focus = enabled
onActiveFocusChanged: if(!activeFocus) focus = enabled
Expand Down

0 comments on commit 2237db2

Please sign in to comment.