X-Git-Url: http://git.zerfleddert.de/cgi-bin/gitweb.cgi/snom-frontend/blobdiff_plain/a3855c1d747b03a5ce93a0f9a233d20aa2260540..ee7ae95211e40e798599cba2075daa456bb38368:/snom.pl diff --git a/snom.pl b/snom.pl index 283b398..b2d4a21 100755 --- a/snom.pl +++ b/snom.pl @@ -1,5 +1,5 @@ #!/bin/sh -#$Id: snom.pl,v 1.1 2006-05-21 11:53:53 simigern Exp $ +#$Id: snom.pl,v 1.4 2006-05-21 12:29:13 simigern Exp $ PATH=/opt/csw/bin:/opt/local/bin:/usr/bin:/bin exec perl -w -x "$0" "$@" @@ -12,8 +12,9 @@ use strict; use LWP::UserAgent; my $ua = LWP::UserAgent->new; +#$ua->credentials("${ARGV[0]}:80","snom","root","geheim"); -#set_locale Gtk2; +set_locale Gtk2; sub snom_key(@) { (my $key) = @_; @@ -138,9 +139,7 @@ $special->show(); my $display = Gtk2::Entry->new(); $display->signal_connect(activate => \&DialNumber); my $kph_blocked = FALSE; -#$display->signal_connect(focus_in_event => \&DisplayMouseOver, TRUE); $display->signal_connect(enter_notify_event => \&DisplayMouseOver, TRUE); -#$display->signal_connect(focus_out_event => \&DisplayMouseOver, FALSE); $display->signal_connect(leave_notify_event => \&DisplayMouseOver, FALSE); $display->show(); @@ -187,6 +186,8 @@ $mainbox->show(); $window->add($mainbox); $window->show(); +$key{OK}->grab_focus(); + # Gtk2 event loop Gtk2->main; @@ -203,7 +204,7 @@ sub KeyPressed 'P7', 'P8', 'P9', 'P10', 'P11', 'P12') { if ($i eq $text) { snom_key($i); - return; + return TRUE; } } @@ -234,12 +235,15 @@ sub KeyPressed snom_key("VOLUME_UP") if ( $text eq "+" ); snom_key("VOLUME_DOWN") if ( $text eq "-" ); + return TRUE; } sub DialNumber { my ($entry) = @_; + snom_number($entry->get_text()); + return TRUE; } sub DisplayMouseOver