You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, for my app based on Dialoguer I need custom keyboard shortcuts like Alt-Q for going back to the main loop or Shift-Enter for adding a multi-line input. However, when I try to accomplish that it simply does not register that output but instead, it just picks the letter without modifier and adds that to the input.
Screenshot
Here's an example to show what I mean:
Instead, it should in this example at least do nothing, but I also added a trigger for this shortcut so in my case it should turn back to the main() loop.
Code
This is the code I used to achieve this:
In return_to_main.rs, I'm polling the shortcut like this:
Hello, for my app based on Dialoguer I need custom keyboard shortcuts like
Alt
-Q
for going back to the main loop orShift
-Enter
for adding a multi-line input. However, when I try to accomplish that it simply does not register that output but instead, it just picks the letter without modifier and adds that to the input.Screenshot
Here's an example to show what I mean:
Instead, it should in this example at least do nothing, but I also added a trigger for this shortcut so in my case it should turn back to the
main()
loop.Code
This is the code I used to achieve this:
In
return_to_main.rs
, I'm polling the shortcut like this:And in my main loop, I'm calling the function here:
Could you add support for
crossterm::event::poll
if possible? Thanks very much. Sincerely, @ThatFrogDevN.B. If you need more code to find where the issue lies, this example is based off my app Notabena: https://github.com/thatfrogdev/notabena.
The text was updated successfully, but these errors were encountered: