Showing posts with label mouse. Show all posts
Showing posts with label mouse. Show all posts

13 January, 2012

Unity -- Mouse Under Keyboard Focus

I've always preferred my focus to follow my mouse in my desktop preferences.

The recent push for the Unity desktop manager for Ubuntu, Debian...has prodded me to try it out.

One of my first challenges was enabling the focus to follow the mouse location. No simple way to do it via preferences, however:


$ gconftool-2 --type string --set /apps/metacity/general/focus_mode mouse
$ gconftool-2 --set /apps/metacity/general/auto_raise -t boolean false


That'll do it.

04 February, 2011

Simulating Mouse Events

I've been struggling to find a suitable testing method to test the Android applications I'm developing. As I'm relatively new to testing UI's I didn't have much to fall back on.

I first began looking at LDTP, but found that the raw mouse events were limited to click and double-clicking left and right buttons. I needed something more flexible to support swiping the Android Emulator.

What I found was 'xdotool' which seems to hit all the marks; activating a window, depressing either mouse button, moving the mouse, and releasing the button(s). Introducting a delay between mouse down and up allows for long press events.

e.g.

$ xdotool windowactivate `exec xdotool search --title 5554:myAvd`
$ xdotool mouse move 100 100
$ xdotool mousedown 1
$ xdotool mouse move 200 200
$ xdotool mouseup 1

Cheers.