#!/bin/sh
-#$Id: snom.pl,v 1.9 2006-05-21 13:12:36 simigern Exp $
+#$Id: snom.pl,v 1.10 2006-05-21 13:26:27 simigern Exp $
PATH=/opt/csw/bin:/opt/local/bin:/usr/bin:/bin exec perl -w -x "$0" "$@"
$fkeys->set_row_spacings(2);
$fkeys->set_col_spacings(2);
$n = 0;
-foreach my $i qw(Redial Settings Directory Help Menu snom _ _ Conference Transfer Hold DND) {
+foreach my $i qw(Redial Settings Directory Help Menu snom _ _ _Conference _Transfer H_old _DND) {
if ($i ne '_') {
$key{$i} = Gtk2::Button->new("${i}");
$key{$i}->signal_connect(clicked => \&KeyPressed, $i);
$output->set_row_spacings(2);
$output->set_col_spacings(2);
$n = 0;
-foreach my $i qw(- + _ Mute Speaker Headset) {
+foreach my $i qw(- + _ _Mute _Speaker _Headset) {
if ( $i ne '_' ) {
$key{$i} = Gtk2::Button->new("${i}");
$key{$i}->signal_connect(clicked => \&KeyPressed, $i);
sub KeyPressed
{
my ($button, $text) = @_;
+ $text=~ s/_//g;
foreach my $i (1, 2, 3, 4, 5, 6, 7, 8, 9, '*', 0, '#',
'F1', 'F2', 'F3', 'F4',
'P1', 'P2', 'P3', 'P4', 'P5', 'P6',
}
}
- if ($keyval == $Gtk2::Gdk::Keysyms{asterisk}) {snom_key('*'); return TRUE;}
- if ($keyval == $Gtk2::Gdk::Keysyms{KP_Multiply}) {snom_key('*'); return TRUE;}
- if ($keyval == $Gtk2::Gdk::Keysyms{numbersign}) {snom_key('#'); return TRUE;}
- if ($keyval == $Gtk2::Gdk::Keysyms{KP_Add}) {snom_key('VOLUME_UP'); return TRUE;}
- if ($keyval == $Gtk2::Gdk::Keysyms{plus}) {snom_key('VOLUME_UP'); return TRUE;}
- if ($keyval == $Gtk2::Gdk::Keysyms{KP_Subtract}) {snom_key('VOLUME_DOWN'); return TRUE;}
- if ($keyval == $Gtk2::Gdk::Keysyms{minus}) {snom_key('VOLUME_DOWN'); return TRUE;}
- if ($keyval == $Gtk2::Gdk::Keysyms{Return}) {snom_key("ENTER"); return TRUE;}
- if ($keyval == $Gtk2::Gdk::Keysyms{KP_Enter}) {snom_key("ENTER"); return TRUE;}
- if ($keyval == $Gtk2::Gdk::Keysyms{Escape}) {snom_key("CANCEL"); return TRUE;}
- if ($keyval == $Gtk2::Gdk::Keysyms{Left}) {snom_key("LEFT"); return TRUE;}
- if ($keyval == $Gtk2::Gdk::Keysyms{KP_Left}) {snom_key("LEFT"); return TRUE;}
- if ($keyval == $Gtk2::Gdk::Keysyms{Right}) {snom_key("RIGHT"); return TRUE;}
- if ($keyval == $Gtk2::Gdk::Keysyms{KP_Right}) {snom_key("RIGHT"); return TRUE;}
- if ($keyval == $Gtk2::Gdk::Keysyms{Up}) {snom_key("UP"); return TRUE;}
- if ($keyval == $Gtk2::Gdk::Keysyms{KP_Up}) {snom_key("UP"); return TRUE;}
- if ($keyval == $Gtk2::Gdk::Keysyms{Down}) {snom_key("DOWN"); return TRUE;}
- if ($keyval == $Gtk2::Gdk::Keysyms{KP_Down}) {snom_key("DOWN"); return TRUE;}
+ if (!$event->state || $event->state eq 'shift-mask') {
+ if ($keyval == $Gtk2::Gdk::Keysyms{asterisk}) {snom_key('*'); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{KP_Multiply}) {snom_key('*'); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{numbersign}) {snom_key('#'); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{KP_Add}) {snom_key('VOLUME_UP'); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{plus}) {snom_key('VOLUME_UP'); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{KP_Subtract}) {snom_key('VOLUME_DOWN'); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{minus}) {snom_key('VOLUME_DOWN'); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{Return}) {snom_key("ENTER"); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{KP_Enter}) {snom_key("ENTER"); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{Escape}) {snom_key("CANCEL"); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{Left}) {snom_key("LEFT"); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{KP_Left}) {snom_key("LEFT"); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{Right}) {snom_key("RIGHT"); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{KP_Right}) {snom_key("RIGHT"); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{Up}) {snom_key("UP"); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{KP_Up}) {snom_key("UP"); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{Down}) {snom_key("DOWN"); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{KP_Down}) {snom_key("DOWN"); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{M}) {snom_key('MUTE'); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{m}) {snom_key('MUTE'); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{S}) {snom_key('SPEAKER'); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{s}) {snom_key('SPEAKER'); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{H}) {snom_key('HEADSET'); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{h}) {snom_key('HEADSET'); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{C}) {snom_key('CONFERENCE'); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{c}) {snom_key('CONFERENCE'); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{T}) {snom_key('TRANSFER'); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{t}) {snom_key('TRANSFER'); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{O}) {snom_key('F_R'); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{o}) {snom_key('F_R'); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{D}) {snom_key('DND'); return TRUE;}
+ if ($keyval == $Gtk2::Gdk::Keysyms{d}) {snom_key('DND'); return TRUE;}
+ }
if (!$event->state) {
for (my $i=1; $i<5; $i++) {