Skip to content

Commit

Permalink
Fix entering unicode characters when using Virtual Keyboard
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed Jan 22, 2025
1 parent d4e7eca commit 9e32e00
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/fifty-bees-boil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nx.js/runtime": patch
---

Fix entering unicode characters when using Virtual Keyboard
6 changes: 3 additions & 3 deletions source/software-keyboard.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void decidedcancel_cb(void) {
// String changed callback.
void strchange_cb(const char *str, SwkbdChangedStringArg *arg) {
JSValue args[] = {
JS_NewStringLen(current_kbd->ctx, str, arg->stringLen),
JS_NewString(current_kbd->ctx, str),
JS_NewInt32(current_kbd->ctx, arg->cursorPos),
JS_NewInt32(current_kbd->ctx, arg->dicStartCursorPos),
JS_NewInt32(current_kbd->ctx, arg->dicEndCursorPos),
Expand All @@ -60,7 +60,7 @@ void strchange_cb(const char *str, SwkbdChangedStringArg *arg) {
// Moved cursor callback.
void movedcursor_cb(const char *str, SwkbdMovedCursorArg *arg) {
JSValue args[] = {
JS_NewStringLen(current_kbd->ctx, str, arg->stringLen),
JS_NewString(current_kbd->ctx, str),
JS_NewInt32(current_kbd->ctx, arg->cursorPos),
};
JSValue result = JS_Call(current_kbd->ctx, current_kbd->cursor_move_func,
Expand All @@ -75,7 +75,7 @@ void movedcursor_cb(const char *str, SwkbdMovedCursorArg *arg) {
// Text submitted callback, this is used to get the output text from submit.
void decidedenter_cb(const char *str, SwkbdDecidedEnterArg *arg) {
JSValue args[] = {
JS_NewStringLen(current_kbd->ctx, str, arg->stringLen),
JS_NewString(current_kbd->ctx, str),
};
JSValue result = JS_Call(current_kbd->ctx, current_kbd->submit_func,
current_kbd->instance, countof(args), args);
Expand Down

0 comments on commit 9e32e00

Please sign in to comment.