# vncviewer and WMII: keyboard shortcuts conflict



## wolfspam (Oct 21, 2012)

I'm having a problems handling a vncviewer session from my desktop machine to my home server while both are running x11-wm/wmii and net/tightvnc, both are same version and compiled from ports with standard configuration.

The problem is that both remote and local window managers use the same keyboard shortcuts, so whenever I try any command like for opening a new xterm via mod-Enter, I end up opening it on the local machine and not the remote session. Is there some way to to easily escape the local shortcut recognition (key grabbing) and send the unaltered command to the remote machine?

The manual page vncviewer(1), cites the -fullscreen command with grabKeyboard setting, but I wasn't very sure how to implement it and how to control the local session of wmii via keyboard once it was working. What would be best for me would be to have everything grabbed by the remote session and a simple key combination used to escape this and issue the command to the local session.

I apologize if the question is still a bit confusing. Ever since I built a small FreeBSD home server early this year, I'm slowly transitioning all machines to the this OS (currently dual-booting windows 8 and FreeBSD 9.0-RELEASE) and it's taking a little getting used to. Other VNC clients, for windows and iOS, work really well with the current setup on the server without any conflicts.


System and port version, same for both client and server:

```
> uname -a
FreeBSD xxxx.xxxx.xxx 9.0-RELEASE FreeBSD 9.0-RELEASE #3: Wed May  9 10:16:01 BRT 2012     root@:/usr/obj/usr/src/sys/CUSTOM  amd64
> pkg info | grep wmii
wmii-3.6_3                     A dynamic, minimalist window manager for X11
> pkg info | grep tightvnc
tightvnc-1.3.10_3              Enhanced version of VNC
```


----------



## wolfspam (Oct 26, 2012)

*Solution*

So the answer was int the default wmiirc, more precisely in this function:


```
Key $MODKEY-Control-t
    case $(wmiir read /keys | wc -l | tr -d ' \t\n') in
    0|1)
        echo -n $Keys | tr ' ' '\012' | wmiir write /keys
        wmiir xwrite /ctl grabmod $MODKEY;;
    *)
        wmiir xwrite /keys $MODKEY-Control-t
        wmiir xwrite /ctl grabmod Mod3;;
    esac
```

I didn't understand it the first time trough (I'm still not quite sure how it does what it does), but now I can work with wmii(1) and vncviewer(1). Next step is learning how to work with wmiir(1) and the 9P filesystem and rewriting this function to work as I want it to.

I just wish it was in the manual for wmii(1), as it seems to be a default key binding.


----------

