Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Does anyone know how to capture a combination of keystrokes from the keyboard to have it poping up a window to display a image or any hidden information about the program, kind of eastern egg?

Replies are listed 'Best First'.
Re: Capturing keystrokes
by hiseldl (Priest) on Oct 10, 2002 at 13:26 UTC

    If you're using Perl/Tk, you could bind a key event to show a dialog.

    If you're on a win box, look at using Term::ReadKey and Win32::GUI::DialogBox.

    --
    hiseldl
    What time is it? It's Camel Time!

Re: Capturing keystrokes
by MZSanford (Curate) on Oct 10, 2002 at 13:33 UTC

    I don't believe you can do thing from a terminal based application. If you are using Win32::GUI, there maybe a way, but i dont think there is a way to capture MouseUp events (like VB), so you would have to partake of some XS hacking to add the feture (and i am sure people would thank you for it).

    In Tk, you can use bind to do what you are thinking of (if i recall)

    ... take a look at the docs for these and other modules at the ever helpful search.cpan.org


    from the frivolous to the serious
Re: Capturing keystrokes
by zentara (Cardinal) on Oct 10, 2002 at 15:35 UTC
    I'm not sure what you are asking? Is this supposed to work from an application? Or do you just want to assign certain keys to functions? If you want to quickly view files, popup graphics, or see file info with a single keystoke, I suggest you look into using midnight commander, "mc". You can assign a "picture viewer" to certain file types, and they will open up just by hitting enter on them. I use "quick image viewer" with my mc, it's 39k and will just pop open any graphic using the gtk toolkit. If you want to view the files, hit F3 and you can look at the file internals, even in hex if you want.
      Thank you all!!