File tree Expand file tree Collapse file tree
kotlin/com/github/animeshz/keyboard Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ plugins {
44
55allprojects {
66 this .group = " com.github.animeshz"
7- this .version = " 0.3.1 "
7+ this .version = " 0.3.2 "
88
99 repositories {
1010 mavenCentral()
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ TSFN ts_callback;
2020
2121void Send (const Napi::CallbackInfo& info) {
2222 int scanCode = info[0 ].As <Napi::Number>().Int32Value ();
23- bool isPressed = info[0 ].As <Napi::Boolean>().Value ();
23+ bool isPressed = info[1 ].As <Napi::Boolean>().Value ();
2424
2525 LinuxKeyboardHandler::getInstance ()->sendEvent (scanCode, isPressed);
2626}
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ TSFN ts_callback;
2020
2121void Send (const Napi::CallbackInfo& info) {
2222 int scanCode = info[0 ].As <Napi::Number>().Int32Value ();
23- bool isPressed = info[0 ].As <Napi::Boolean>().Value ();
23+ bool isPressed = info[1 ].As <Napi::Boolean>().Value ();
2424
2525 WindowsKeyboardHandler::getInstance ()->sendEvent (scanCode, isPressed);
2626}
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ import kotlinx.coroutines.flow.onEach
1111@ExperimentalKeyIO
1212internal object KotlinJsKeyboardHandler : NativeKeyboardHandlerBase() {
1313 init {
14- if (NApiNativeHandler .init () != 0 ) {
14+ if (NApiNativeHandler .init ().toInt() != 0 ) {
1515 error(" Native initialization failed" )
1616 }
1717 }
@@ -34,7 +34,7 @@ internal object KotlinJsKeyboardHandler : NativeKeyboardHandlerBase() {
3434 eventsInternal.tryEmit(KeyEvent (Key .fromKeyCode(scanCode), isPressed.toKeyState()))
3535 }
3636
37- if (code != 0 ) {
37+ if (code.toInt() != 0 ) {
3838 error(" Unable to set native hook. Error code: $code " )
3939 }
4040 }
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ internal external interface INApiNativeHandler {
2727 fun isNumLockOn (): Boolean
2828 fun isScrollLockOn (): Boolean
2929
30- fun init (): Int
31- fun startReadingEvents (handler : (scanCode: Int , isPressed: Boolean ) -> Unit ): Int
30+ fun init (): Number
31+ fun startReadingEvents (handler : (scanCode: Int , isPressed: Boolean ) -> Unit ): Number
3232 fun stopReadingEvents ()
3333}
Original file line number Diff line number Diff line change 3333 "email" : " animeshsahu19@yahoo.com"
3434 },
3535 "repository" : {
36- "url" : " https://animeshz. github.io /keyboard-mouse-kt"
36+ "url" : " https://github.com/animeshz /keyboard-mouse-kt"
3737 },
3838 "bugs" : {
3939 "url" : " https://animeshz.github.io/keyboard-mouse-kt/issues"
You can’t perform that action at this time.
0 commit comments