in reply to Creating keybinds GLOBALY!

Setting up Tk event callbacks, including key pressing events are explained thoroughly in the chapter 'Anatomy of the main loop' of O'Reilly's 'Mastering perl/Tk'. ISBN 1565927168

Update: the chapter is available on line: http://www.oreilly.com/catalog/mastperltk/chapter/ch15.html - to find the relevant section keystroke events come under the event class of 'window events'

One world, one people

Replies are listed 'Best First'.
Re^2: Creating keybinds GLOBALY!
by Ace128 (Hermit) on Aug 04, 2005 at 11:15 UTC
    Ah, yes. That binding I know of... However, it doesnt work when window is out of focus... (as I recall)
      If the window is out of focus, Windows will deliver the keystrokes to whichever application it considers to be in focus. That fact has nothing to do at all with whatever perl method you use to capture the keystrokes. In fact that behaviour is user-configurable under linux and windows and is therefore entirely beyond the power of the programmer (unless you hack the O/S and invent your personal GUI paradigm).

      One world, one people

      If you set up a shortcut to the perl/tk app. on the desktop, then you can also setup a shortcut ket that will start the app regardless of what application currently has the focus.


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
      "Science is about questioning the status quo. Questioning authority".
      The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.