I don't know how you could do what you want. You seem to want to override the basic window focus mechanism. You essentially would be creating a keystroke logger. I just saw PyKeyLogger I was wondering how to convert that to Perl?

The best solution is to build a single app, that incorporates the browser view and the pan controls... see embedding Dillo Html browser in a Tk app. I havn't had much luck with it, but Gtk2 has a MozEmbed library, which supposedly lets you embed applications with Mozilla. This is where Java has a great advantage over Perl, with it's java brower plugin. Maybe switch to java, or write a Flash program that can be run in the browser?

Another suggestion is google for "xbindkeys", and setup a daemon to intercept the keys, or google for "xvkdb"... the X virtual keyboard.

Is it possible to use the "tab focus shift" mechanism (or whatever your window manger uses to shift focus by the keyboard) to toggle focus between the browser and Tk app?

Is it really that hard to move the mouse back and forth between the browser and Tk window? There are ways to keep the Tk window "on top" if your window manager hides it when out of focus.


I'm not really a human, but I play one on earth. Cogito ergo sum a bum

In reply to Re^4: Perl/TK KeyPress/Release minimized by zentara
in thread Perl/TK KeyPress/Release minimized by Ressor

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.