Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jan 2002 09:43:32 +0100
From:      walter@belgers.com (Walter Belgers)
To:        freebsd-mobile@freebsd.org
Subject:   Re: vaio's jogdial & moused
Message-ID:  <20020115094332.B58555@teletubbie.no>
In-Reply-To: <20020114223408.GA4272@aviaport.ru>; from j@gu.ru on Tue, Jan 15, 2002 at 01:34:08AM %2B0300
References:  <20020114223408.GA4272@aviaport.ru>

next in thread | previous in thread | raw e-mail | index | archive | help

--LZvS9be/3tNcYl/X
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

Juriy Goloveshkin wrote:
> I made a little hack for moused to use jogdial like a wheel.

I use the jogdial to switch desktops in Enlightenment using an ugly Perl
hack (only for Enlightenment users on a Vaio running CURRENT).
I'll attach it.

Cheers,
Walter.
-- 
Walter Belgers         "Si hoc signum legere potes, operis boni in rebus
walter@belgers.com       Latinis alacribus et fructuosis potiri potes!" 

--LZvS9be/3tNcYl/X
Content-Type: application/x-perl
Content-Disposition: attachment; filename="jog.pl"

#!/usr/bin/perl

# script that reads the Sony Jogdial and changes virtual desktop
# according to the jogdial movement. uses 'eesh' that comes with
# enlightenment

# Walter Belgers Wed Oct 17 17:31:20 CEST 2001

use strict;

my $left=0;
my $right=1024;	# nicer would be to use 'general_info screen_size'

my $pos=$left;	# position
my $desk=0;	# desktop (0==top, 1==bottom)

open jogdial, "</dev/jogdial" or die "Can't open jogdial device!\n";

while(my $char = getc(jogdial)) {
  if ($char eq "l") {
    # left
    if ($pos != $left) {
	$pos=$left;
	system("eesh -e 'goto_area $pos 0'");
    }
  } elsif ($char eq "r") {
    # right
    if ($pos != $right) {
	$pos=$right;
	system("eesh -e 'goto_area $pos 0'");
    }
  } elsif ($char eq "u") {
    # up
    $desk=1-$desk;
    system("eesh -e 'goto_desktop $desk'");
    system("eesh -e 'goto_area $pos'");
  } else {
    # down, do nothing
  }
}

--LZvS9be/3tNcYl/X--

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-mobile" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020115094332.B58555>