Skip to content

Commit 6fc8b5e

Browse files
committed
Implement unregister all hotkeys
1 parent 13fe756 commit 6fc8b5e

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

source/hook.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1080,5 +1080,12 @@ void UnregisterHotkeyJS(const v8::FunctionCallbackInfo<v8::Value>& args) {
10801080
}
10811081

10821082
void UnregisterHotkeysJS(const v8::FunctionCallbackInfo<v8::Value>& args) {
1083-
//TODO
1083+
pthread_mutex_lock(&pressed_keys_mutex);
1084+
pthread_mutex_lock(&released_keys_mutex);
1085+
1086+
pressedKeyEventCallbacks.clear();
1087+
releasedKeyEventCallbacks.clear();
1088+
1089+
pthread_mutex_unlock(&pressed_keys_mutex);
1090+
pthread_mutex_unlock(&released_keys_mutex);
10841091
}

0 commit comments

Comments
 (0)