On Tue, Oct 28, 2008 at 06:41:10PM -0500, Naren wrote:
Is there a way to tell wmii to not capture the keybindings when a
window is in fullscreen mode or something like that ? What other way
can I deal with this ?

I actually have a very similar situation using Xephyr to test wmii. I have a special tag, 'x', that automatically removes all key bindings when selected and removes them when deselected. The Mod-x binding is the exception, as it toggles between the 'x' tag and the previous tag, no matter what. The following rc code does the job for me:

# A special hack for running Xephyr. When switching to the ‘x’ tag,
# disable all key and mouse bindings so I can run a test instance
# of wmii there. The M-x binding is the only one retained, and can
# toggle between the ‘x’ view and the previous view.
fn Key-$MODKEY-x {
        seltag = `{wi_seltag}
        switch($"seltag) {
        case x
                if(~ $"_x_tag '')
                        wmiir xwrite /ctl view $viewprev
                if not
                        wmiir xwrite /ctl view $_x_tag
                _x_tag=()
        case *
                _x_tag = $seltag
                wmiir xwrite /ctl view x
        }}

# Also, add a M-i binding to toggle between the two most
# recent views. For convenience, this code is tied to the
# M-x code.
fn Key-$mod-i {
        wmiir xwrite /ctl view $viewprev}

_x_keys=()
viewprev=1
fn Event-UnfocusTag {
        if(! ~ $"* x)
                viewprev=$"*
        wmiir xwrite /lbar/$"* $wmiinormcol $*}
fn Event-FocusTag {
        wmiir xwrite /lbar/$"* $wmiifocuscol $*
        switch($"*) {
        case x
                ifs=() { _x_keys=`{wmiir read /keys} }
                wmiir xwrite /keys $MODKEY-x
                wmiir xwrite /ctl grabmod Mod3
                wiwarp `{rc -c 'DISPLAY=:1 wilsptr'}
                # wi ls ptr: print pointer coordinates
        case *
                if(! ~ $"_x_keys '') {
                        wmiir xwrite /ctl grabmod $MODKEY
                        wmiir xwrite /keys $_x_keys
                        _x_keys=() }
        }}


It could probably be simplified a bit, but I haven't looked at it in a while.

--
Kris Maglione

Fast, fat computers breed slow, lazy programmers.
        --Robert Hummel


Reply via email to