Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,15 @@ internal object KeyboardManager {
val isCtrl = nativeEvent.modifiers.and(NativeKeyEvent.CTRL_MASK) > 0
val isAlt = nativeEvent.modifiers.and(NativeKeyEvent.VC_ALT) > 0

if (!isCtrl && !isAlt) return
if (!isCtrl || !isAlt) return

val event = when (nativeEvent.keyCode) {
NativeKeyEvent.VC_F10 -> KeyboardEvent.ToggleOverlay
NativeKeyEvent.VC_F11 -> KeyboardEvent.ToggleRecording
else -> null
}
event?.let { _channel.trySend(it) }
event?.let { _channel.trySend(it) }
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe it's not working because the channel initialisation is wrong or the other side collecting it is converting to a flow with wrong parameters?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check this answer from Claude

https://claude.ai/share/5fc461d3-d2e2-4753-a706-9ec03b67ddb9

Maybe option 2 is a better alternative?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did try the first suggestion with an unlimited channel already, but it didn't work and also seems like a dirty fix.

The second one looks surprisingly good. I will try another approach and update this PR once done. I don't like duplicating this line either 😂

}
})
} catch (e: Throwable) {
Expand Down