Skip to content

Commit 9e32e00

Browse files
committed
Fix entering unicode characters when using Virtual Keyboard
1 parent d4e7eca commit 9e32e00

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

.changeset/fifty-bees-boil.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@nx.js/runtime": patch
3+
---
4+
5+
Fix entering unicode characters when using Virtual Keyboard

source/software-keyboard.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ void decidedcancel_cb(void) {
4343
// String changed callback.
4444
void strchange_cb(const char *str, SwkbdChangedStringArg *arg) {
4545
JSValue args[] = {
46-
JS_NewStringLen(current_kbd->ctx, str, arg->stringLen),
46+
JS_NewString(current_kbd->ctx, str),
4747
JS_NewInt32(current_kbd->ctx, arg->cursorPos),
4848
JS_NewInt32(current_kbd->ctx, arg->dicStartCursorPos),
4949
JS_NewInt32(current_kbd->ctx, arg->dicEndCursorPos),
@@ -60,7 +60,7 @@ void strchange_cb(const char *str, SwkbdChangedStringArg *arg) {
6060
// Moved cursor callback.
6161
void movedcursor_cb(const char *str, SwkbdMovedCursorArg *arg) {
6262
JSValue args[] = {
63-
JS_NewStringLen(current_kbd->ctx, str, arg->stringLen),
63+
JS_NewString(current_kbd->ctx, str),
6464
JS_NewInt32(current_kbd->ctx, arg->cursorPos),
6565
};
6666
JSValue result = JS_Call(current_kbd->ctx, current_kbd->cursor_move_func,
@@ -75,7 +75,7 @@ void movedcursor_cb(const char *str, SwkbdMovedCursorArg *arg) {
7575
// Text submitted callback, this is used to get the output text from submit.
7676
void decidedenter_cb(const char *str, SwkbdDecidedEnterArg *arg) {
7777
JSValue args[] = {
78-
JS_NewStringLen(current_kbd->ctx, str, arg->stringLen),
78+
JS_NewString(current_kbd->ctx, str),
7979
};
8080
JSValue result = JS_Call(current_kbd->ctx, current_kbd->submit_func,
8181
current_kbd->instance, countof(args), args);

0 commit comments

Comments
 (0)