How can I define+handle global keyboard in the ruby desktop application? I'm running Linux and using Qt. My program should be in the system tray and whenever some global keyboard shortcut is pushed, it should handle it.
Asked
Active
Viewed 227 times
0
-
1I suppose you need to hook into the WM for that. – Reactormonk Nov 20 '12 at 07:27
-
1libqxt http://dev.libqxt.org/libqxt/wiki/Home has global shortcuts – Kamil Klimek Nov 20 '12 at 08:33
-
@Kamil: I didn't see any ruby bindings to libqxt, is there an easy way to use the library in ruby? – Peter Butkovic Nov 20 '12 at 15:33
-
1Well this is topic for another question. Someone already asked it at stackoverflow: http://stackoverflow.com/questions/1542520/how-can-i-call-c-functions-from-within-ruby – Kamil Klimek Nov 20 '12 at 15:59
-
@KamilKlimek thanks a lot! I think I'll try the approach suggested by you and see how far I come :) if you're interested, post your comments in an answer (to get points) as I consider your answer as the correct/complete one! – Peter Butkovic Nov 20 '12 at 19:56
1 Answers
1
You can get global shortcuts using libqxt (as you're already using Qt it shouldn't bother you). If you need to use them directly in Ruby then you should check this question: How can I call C++ functions from within ruby

Community
- 1
- 1

Kamil Klimek
- 12,884
- 2
- 43
- 58