ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/UI.pm
Revision: 1.33
Committed: Sun Apr 9 01:37:58 2006 UTC (18 years, 2 months ago) by root
Branch: MAIN
Changes since 1.32: +2 -1 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 elmex 1.6 package Crossfire::Client::Widget;
2 root 1.8
3 elmex 1.1 use strict;
4 root 1.18
5     use Scalar::Util;
6    
7 elmex 1.11 use SDL::OpenGL;
8     use SDL::OpenGL::Constants;
9 elmex 1.1
10     our $FOCUS; # the widget with current focus
11 elmex 1.32 #our @ACTIVE_WIDGETS;
12 elmex 1.1
13     # class methods for events
14     sub feed_sdl_key_down_event { $FOCUS->key_down ($_[0]) if $FOCUS }
15     sub feed_sdl_key_up_event { $FOCUS->key_up ($_[0]) if $FOCUS }
16 elmex 1.32 sub feed_sdl_button_down_event { }
17     sub feed_sdl_button_up_event { }
18 elmex 1.1
19     sub new {
20     my $class = shift;
21 root 1.10
22     bless { @_ }, $class
23 elmex 1.1 }
24    
25 elmex 1.32 #sub activate {
26     # push @ACTIVE_WIDGETS, $_[0];
27     # Scalar::Util::weaken $ACTIVE_WIDGETS[-1];
28     #}
29 root 1.4
30 elmex 1.32 #sub deactivate {
31     # @ACTIVE_WIDGETS =
32     # sort { $a->{z} <=> $b->{z} }
33     # grep { $_ && $_ != $_[0] }
34     # @ACTIVE_WIDGETS;
35     #}
36 elmex 1.2
37 root 1.18 sub move {
38     my ($self, $x, $y, $z) = @_;
39     $self->{x} = $x;
40     $self->{y} = $y;
41     $self->{z} = $z if defined $z;
42     }
43    
44 elmex 1.20 sub needs_redraw {
45     0
46     }
47    
48 root 1.14 sub size_request {
49     die "size_request is abtract";
50     }
51    
52 elmex 1.1 sub focus_in {
53     my ($widget) = @_;
54     $FOCUS = $widget;
55     }
56 root 1.4
57 elmex 1.1 sub focus_out {
58     my ($widget) = @_;
59     }
60 root 1.4
61 elmex 1.1 sub key_down {
62     my ($widget, $sdlev) = @_;
63     }
64 root 1.4
65 elmex 1.1 sub key_up {
66     my ($widget, $sdlev) = @_;
67     }
68 root 1.4
69 elmex 1.1 sub button_down {
70     my ($widget, $sdlev) = @_;
71     }
72 root 1.4
73 elmex 1.1 sub button_up {
74     my ($widget, $sdlev) = @_;
75     }
76 root 1.4
77 elmex 1.15 sub w { $_[0]->{w} }
78     sub h { $_[0]->{h} }
79 elmex 1.11 sub x { $_[0]->{x} = $_[1] if $_[1]; $_[0]->{x} }
80     sub y { $_[0]->{y} = $_[1] if $_[1]; $_[0]->{y} }
81 elmex 1.13 sub z { $_[0]->{z} = $_[1] if $_[1]; $_[0]->{z} }
82 elmex 1.11
83 elmex 1.1 sub draw {
84 elmex 1.11 my ($self) = @_;
85    
86     glPushMatrix;
87 root 1.12 glTranslate $self->{x}, $self->{y}, 0;
88 elmex 1.11 $self->_draw;
89     glPopMatrix;
90     }
91    
92     sub _draw {
93 elmex 1.1 my ($widget) = @_;
94     }
95 root 1.4
96 elmex 1.1 sub bbox {
97 elmex 1.32 my ($self) = @_;
98     my ($w, $h) = $self->size_request;
99     (
100     $self->{x},
101     $self->{y},
102     $self->{x} = $w,
103     $self->{y} = $h
104     )
105     }
106    
107     sub del_parent { $_[0]->{parent} = undef }
108    
109     sub set_parent {
110     my ($self, $par) = @_;
111    
112     $self->{parent} = $par;
113     Scalar::Util::weaken $self->{parent};
114     }
115    
116     sub get_parent {
117     $_[0]->{parent}
118     }
119    
120     sub update {
121     my ($self) = @_;
122    
123     $self->{parent}->update
124     if $self->{parent};
125 elmex 1.1 }
126 elmex 1.2
127 root 1.18 sub DESTROY {
128     my ($self) = @_;
129    
130 elmex 1.32 #$self->deactivate;
131 root 1.18 }
132    
133 elmex 1.15 package Crossfire::Client::Widget::Container;
134    
135     our @ISA = Crossfire::Client::Widget::;
136    
137     use SDL::OpenGL;
138    
139 elmex 1.32 sub add { $_[0]->{child} = $_[1]; $_[1]->set_parent ($_[0]); $_[1]->update }
140 elmex 1.15 sub get { $_[0]->{child} }
141 elmex 1.32 sub remove {
142     my ($self, $chld) = @_;
143     delete $self->{child}
144     if $self->{child} == $chld;
145     }
146 elmex 1.15
147     sub size_request { $_[0]->{child}->size_request if $_[0]->{child} }
148    
149     sub _draw { die "Containers can't be drawn!" }
150    
151 elmex 1.32 package Crossfire::Client::Widget::Toplevel;
152    
153     our @ISA = Crossfire::Client::Widget::;
154    
155     use SDL::OpenGL;
156    
157     sub add {
158     my ($self, $chld) = @_;
159    
160     push @{$self->{childs}}, $chld;
161     @{$self->{childs}} =
162     sort { $a->{z} <=> $b->{z} }
163     @{$self->{childs}};
164    
165     $chld->set_parent ($self);
166     }
167    
168     sub remove {
169     my ($self, $chld) = @_;
170     @{$self->{childs}} =
171     sort { $a->{z} <=> $b->{z} }
172     grep { $_ && $_ != $_[0] }
173     @{$self->{childs}}
174     }
175    
176     sub update {
177     my ($self) = @_;
178     ::refresh ();
179     }
180    
181     sub _draw {
182     my ($self) = @_;
183    
184     $_->draw for @{$self->{childs}};
185     }
186    
187 elmex 1.20 package Crossfire::Client::Widget::Window;
188    
189     our @ISA = Crossfire::Client::Widget::Container::;
190    
191     use SDL::OpenGL;
192    
193     sub add {
194     my ($self, $chld) = @_;
195     $self->SUPER::add ($chld);
196 elmex 1.32 $chld->set_parent ($self);
197     $self->update; #TODO: Move this to the size_request event propably?
198     }
199    
200     sub remove {
201     my ($self) = @_;
202     # TODO FIXME: removing a child from a window will crash, see render_chld
203     $self->update;
204     }
205    
206     sub update {
207     my ($self) = @_;
208     $self->render_chld;
209 elmex 1.20 }
210    
211     sub render_chld {
212     my ($self) = @_;
213     my $chld = $self->get;
214     my ($w, $h) = $self->size_request;
215    
216     $self->{texture} =
217     Crossfire::Client::Texture->new_from_opengl (
218 root 1.23 $w, $h, sub { $chld->draw }
219 elmex 1.20 );
220     $self->{texture}->upload;
221     }
222    
223     sub size_request {
224     my ($self) = @_;
225     my $chld = $self->get
226     or return (0, 0);
227     $chld->size_request
228     }
229    
230     sub _draw {
231     my ($self) = @_;
232    
233 root 1.29 my ($w, $h) = $self->size_request;#TODO# use width/height of texture
234    
235 elmex 1.20 my $tex = $self->{texture}
236     or return;
237    
238     glEnable GL_BLEND;
239     glEnable GL_TEXTURE_2D;
240     glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE;
241     glBindTexture GL_TEXTURE_2D, $tex->{name};
242    
243 elmex 1.31 glColor 1, 0, 1;
244 elmex 1.20
245     glBegin GL_QUADS;
246 root 1.23 glTexCoord 0, 0; glVertex 0, 0;
247     glTexCoord 0, 1; glVertex 0, $h;
248     glTexCoord 1, 1; glVertex $w, $h;
249     glTexCoord 1, 0; glVertex $w, 0;
250 elmex 1.20 glEnd;
251    
252     glDisable GL_BLEND;
253     glDisable GL_TEXTURE_2D;
254     }
255    
256 elmex 1.15 package Crossfire::Client::Widget::Frame;
257    
258     our @ISA = Crossfire::Client::Widget::Container::;
259    
260     use SDL::OpenGL;
261    
262     sub size_request {
263     my ($self) = @_;
264     my $chld = $self->get
265     or return (0, 0);
266 root 1.30
267     $chld->move (2, 2);
268    
269 elmex 1.15 map { $_ + 4 } $chld->size_request;
270     }
271    
272     sub _draw {
273     my ($self) = @_;
274    
275     my $chld = $self->get;
276    
277     my ($w, $h) = $chld->size_request;
278    
279     glBegin GL_QUADS;
280 root 1.30 glColor 0, 0, 0;
281 elmex 1.15 glTexCoord 0, 0; glVertex 0 , 0;
282     glTexCoord 0, 1; glVertex 0 , $h + 4;
283     glTexCoord 1, 1; glVertex $w + 4 , $h + 4;
284     glTexCoord 1, 0; glVertex $w + 4 , 0;
285     glEnd;
286    
287 root 1.23 $chld->draw;
288 elmex 1.15 }
289    
290 elmex 1.31 package Crossfire::Client::Widget::FancyFrame;
291    
292     our @ISA = Crossfire::Client::Widget::Frame::;
293    
294     use SDL::OpenGL;
295    
296     #TODO: implement themed frame
297    
298 elmex 1.15 package Crossfire::Client::Widget::Table;
299    
300     our @ISA = Crossfire::Client::Widget::Container::;
301    
302     use SDL::OpenGL;
303    
304     sub add {
305     my ($self, $x, $y, $chld) = @_;
306 elmex 1.32 my $old_chld = $self->{childs}[$y][$x];
307    
308 elmex 1.15 $self->{childs}[$y][$x] = $chld;
309 elmex 1.32 $chld->set_parent ($self);
310     $self->update;
311 elmex 1.15 }
312    
313     sub max_row_height {
314     my ($self, $row) = @_;
315    
316     my $hs = 0;
317     for (my $xi = 0; $xi <= $#{$self->{childs}->[$row] || []}; $xi++) {
318     my $c = $self->{childs}->[$row]->[$xi];
319 elmex 1.17 if ($c) {
320     my ($w, $h) = $c->size_request;
321     if ($hs < $h) { $hs = $h }
322     }
323 elmex 1.15 }
324     return $hs;
325     }
326    
327     sub max_col_width {
328     my ($self, $col) = @_;
329    
330     my $ws = 0;
331     for (my $yi = 0; $yi <= $#{$self->{childs} || []}; $yi++) {
332     my $c = ($self->{childs}->[$yi] || [])->[$col];
333 elmex 1.17 if ($c) {
334     my ($w, $h) = $c->size_request;
335     if ($ws < $w) { $ws = $w }
336     }
337 elmex 1.15 }
338     return $ws;
339     }
340    
341     sub size_request {
342     my ($self) = @_;
343    
344     my ($hs, $ws) = (0, 0);
345    
346     for (my $yi = 0; $yi <= $#{$self->{childs}}; $yi++) {
347     $hs += $self->max_row_height ($yi);
348     }
349    
350     for (my $yi = 0; $yi <= $#{$self->{childs}}; $yi++) {
351     my $wm = 0;
352     for (my $xi = 0; $xi <= $#{$self->{childs}->[$yi]}; $xi++) {
353     $wm += $self->max_col_width ($xi)
354     }
355     if ($ws < $wm) { $ws = $wm }
356     }
357    
358     return ($ws, $hs);
359     }
360    
361     sub _draw {
362     my ($self) = @_;
363    
364     my $y = 0;
365     for (my $yi = 0; $yi <= $#{$self->{childs}}; $yi++) {
366     my $x = 0;
367    
368     for (my $xi = 0; $xi <= $#{$self->{childs}->[$yi]}; $xi++) {
369    
370     my $c = $self->{childs}->[$yi]->[$xi];
371 elmex 1.26 if ($c) {
372     $c->move ($x, $y, 0); #TODO: Move to size_request
373     $c->draw if $c;
374     }
375 elmex 1.15
376     $x += $self->max_col_width ($xi);
377     }
378    
379     $y += $self->max_row_height ($yi);
380     }
381     }
382    
383     package Crossfire::Client::Widget::VBox;
384    
385     our @ISA = Crossfire::Client::Widget::Container::;
386    
387     use SDL::OpenGL;
388    
389     sub add {
390     my ($self, $chld) = @_;
391     push @{$self->{childs}}, $chld;
392 elmex 1.32 $chld->set_parent ($self);
393     $self->update;
394 elmex 1.15 }
395    
396     sub size_request {
397     my ($self) = @_;
398    
399     my ($hs, $ws) = (0, 0);
400     for (@{$self->{childs} || []}) {
401     my ($w, $h) = $_->size_request;
402     $hs += $h;
403     if ($ws < $w) { $ws = $w }
404     }
405    
406     return ($ws, $hs);
407     }
408    
409     sub _draw {
410     my ($self) = @_;
411    
412     my ($x, $y);
413     for (@{$self->{childs} || []}) {
414 elmex 1.26 $_->move (0, $y, 0); #TODO: move to size_request
415 root 1.23 $_->draw;
416 elmex 1.15 my ($w, $h) = $_->size_request;
417     $y += $h;
418     }
419     }
420    
421 root 1.10 package Crossfire::Client::Widget::Label;
422    
423 root 1.12 our @ISA = Crossfire::Client::Widget::;
424    
425 root 1.10 use SDL::OpenGL;
426    
427     sub new {
428 root 1.28 my ($class, $x, $y, $z, $height, $text) = @_;
429 root 1.10
430 root 1.33 # TODO: color, and make height, xyz etc. optional
431 root 1.28 my $self = $class->SUPER::new (x => $x, y => $y, z => $z, height => $height);
432 root 1.10
433 elmex 1.15 $self->set_text ($text);
434 root 1.10
435     $self
436     }
437    
438 elmex 1.15 sub set_text {
439     my ($self, $text) = @_;
440 root 1.28
441     $self->{text} = $text;
442 elmex 1.32 $self->{texture} = new_from_text Crossfire::Client::Texture $text, $self->{height};
443 root 1.28
444 elmex 1.32 $self->update;
445 elmex 1.15 }
446    
447     sub get_text {
448     my ($self, $text) = @_;
449 root 1.28
450 elmex 1.15 $self->{text}
451     }
452    
453 root 1.14 sub size_request {
454     my ($self) = @_;
455    
456     (
457     $self->{texture}{width},
458     $self->{texture}{height},
459     )
460     }
461    
462 elmex 1.11 sub _draw {
463 root 1.10 my ($self) = @_;
464    
465     my $tex = $self->{texture};
466    
467 root 1.12 glEnable GL_BLEND;
468 root 1.10 glEnable GL_TEXTURE_2D;
469 root 1.30 glBlendFunc GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA;
470 root 1.28 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE;
471 root 1.10 glBindTexture GL_TEXTURE_2D, $tex->{name};
472    
473 root 1.33 glColor 1, 1, 1, 0.6; # TODO color
474 root 1.12
475 root 1.10 glBegin GL_QUADS;
476     glTexCoord 0, 0; glVertex 0 , 0;
477     glTexCoord 0, 1; glVertex 0 , $tex->{height};
478     glTexCoord 1, 1; glVertex $tex->{width}, $tex->{height};
479     glTexCoord 1, 0; glVertex $tex->{width}, 0;
480     glEnd;
481    
482 root 1.12 glDisable GL_BLEND;
483 root 1.10 glDisable GL_TEXTURE_2D;
484     }
485    
486 elmex 1.31 package Crossfire::Client::Widget::TextEntry;
487    
488     our @ISA = Crossfire::Client::Widget::Label::;
489    
490     use SDL;
491     use SDL::OpenGL;
492    
493     sub key_down {
494     my ($self, $ev) = @_;
495    
496     my $mod = $ev->key_mod;
497     my $sym = $ev->key_sym;
498    
499     $ev->set_unicode (1);
500     my $uni = $ev->key_unicode;
501    
502     my $text = $self->get_text;
503    
504     if ($sym == SDLK_BACKSPACE) {
505     substr $text, -1, 1, '';
506    
507     } elsif ($uni) {
508     $text .= chr $uni;
509     }
510     $self->set_text ($text);
511     }
512    
513    
514     # XXX: TextView isn't neccessary with pango multiline text rendering
515 elmex 1.9 package Crossfire::Client::Widget::TextView;
516 root 1.4
517 elmex 1.3 use strict;
518 root 1.10
519 elmex 1.9 our @ISA = qw/Crossfire::Client::Widget/;
520 elmex 1.3
521     use SDL::OpenGL;
522     use SDL::OpenGL::Constants;
523    
524 elmex 1.31 sub new {
525     my ($class, $text, $h) = @_;
526     my $self = $class->SUPER::new ();
527    
528     $self->{txt_height} = $h;
529     @{$self->{lines}} = split /\r?\n/, $text;
530    
531     for (split /\r?\n/, $text) {
532     $self->add_line ($_);
533     }
534     $self
535     }
536    
537     #sub render_lines {
538     # my ($self) = @_;
539     #
540     # $self->{txt_lines} = [];
541     #
542     # for (@{$self->{lines}}) {
543     # push @{$self->{txt_lines}},
544     # new_from_ttf Crossfire::Client::Texture $self->{ttf}, $_;
545     # }
546     #}
547    
548 elmex 1.3 sub add_line {
549     my ($self, $line) = @_;
550     push @{$self->{lines}}, $line;
551 elmex 1.31
552     push @{$self->{txt_lines}},
553     new_from_text Crossfire::Client::Texture $line, $self->{txt_height};
554     }
555    
556     sub size_request {
557     my ($self) = @_;
558    
559     my $w = 0;
560     my $h = 0;
561    
562     for (@{$self->{txt_lines}}) {
563     if ($w < $_->{width}) { $w = $_->{width} }
564     $h += $_->{height};
565     }
566    
567     return ($w, $h);
568     }
569    
570     sub draw_line {
571     my ($self, $tex, $y) = @_;
572    
573     glBindTexture GL_TEXTURE_2D, $tex->{name};
574    
575     glColor 1, 0, 1;
576    
577     glBegin GL_QUADS;
578     glTexCoord 0, 0; glVertex 0 , $y;
579     glTexCoord 0, 1; glVertex 0 , $y + $tex->{height};
580     glTexCoord 1, 1; glVertex $tex->{width}, $y + $tex->{height};
581     glTexCoord 1, 0; glVertex $tex->{width}, $y;
582     glEnd;
583 elmex 1.3 }
584    
585 elmex 1.11 sub _draw {
586 elmex 1.3 my ($self) = @_;
587    
588 elmex 1.31 glEnable GL_BLEND;
589     glEnable GL_TEXTURE_2D;
590     glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE;#DECAL;
591    
592     my $l = 0;
593     for (@{$self->{txt_lines}}) {
594     $self->draw_line ($_, $l);
595     $l += $_->{height};
596     }
597    
598     glDisable GL_BLEND;
599     glDisable GL_TEXTURE_2D;
600 elmex 1.3 }
601    
602 elmex 1.9 package Crossfire::Client::Widget::MapWidget;
603 root 1.4
604 elmex 1.2 use strict;
605 elmex 1.7
606 root 1.25 use List::Util qw(min max);
607 elmex 1.2
608 root 1.16 use SDL;
609 elmex 1.2 use SDL::OpenGL;
610     use SDL::OpenGL::Constants;
611    
612 root 1.25 our @ISA = Crossfire::Client::Widget::;
613    
614 elmex 1.2 sub key_down {
615     print "MAPKEYDOWN\n";
616     }
617    
618     sub key_up {
619     }
620    
621 elmex 1.11 sub _draw {
622 root 1.21 my ($self) = @_;
623    
624 root 1.25 my $mx = $::CONN->{mapx};
625     my $my = $::CONN->{mapy};
626    
627     my $map = $::CONN->{map};
628    
629     my ($xofs, $yofs);
630    
631     my $sw = 1 + int $::WIDTH / 32;
632     my $sh = 1 + int $::HEIGHT / 32;
633    
634     if ($::CONN->{mapw} > $sw) {
635 root 1.27 $xofs = $mx + ($::CONN->{mapw} - $sw) * 0.5;
636 root 1.25 } else {
637     $xofs = $self->{xofs} = min $mx, max $mx + $::CONN->{mapw} - $sw + 1, $self->{xofs};
638     }
639    
640     if ($::CONN->{maph} > $sh) {
641 root 1.27 $yofs = $my + ($::CONN->{maph} - $sh) * 0.5;
642 root 1.25 } else {
643     $yofs = $self->{yofs} = min $my, max $my + $::CONN->{maph} - $sh + 1, $self->{yofs};
644     }
645    
646 elmex 1.2 glEnable GL_TEXTURE_2D;
647     glEnable GL_BLEND;
648 root 1.12 glTexEnv GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE;
649 elmex 1.2
650 root 1.25 for my $x (0 .. $sw - 1) {
651     for my $y (0 .. $sh - 1) {
652 elmex 1.2
653 root 1.25 my $cell = $map->[$x + $xofs][$y + $yofs]
654 elmex 1.2 or next;
655    
656 root 1.21 my $darkness = $cell->[0] * (1 / 255);
657     if ($darkness < 0) {
658 root 1.24 glColor 0.3, 0.3, 0.3;
659     } else {
660     glColor $darkness, $darkness, $darkness;
661 root 1.21 }
662 elmex 1.2
663 root 1.21 for my $num (grep $_, @$cell[1,2,3]) {
664 root 1.4 my $tex = $::CONN->{face}[$num]{texture} || next;
665 elmex 1.2
666 root 1.4 glBindTexture GL_TEXTURE_2D, $tex->{name};
667 elmex 1.2
668 root 1.19 my $w = $tex->{width};
669     my $h = $tex->{height};
670    
671     my $px = ($x + 1) * 32 - $w;
672     my $py = ($y + 1) * 32 - $h;
673    
674 elmex 1.2 glBegin GL_QUADS;
675 root 1.19 glTexCoord 0, 0; glVertex $px , $py;
676     glTexCoord 0, 1; glVertex $px , $py + $h;
677     glTexCoord 1, 1; glVertex $px + $w, $py + $h;
678     glTexCoord 1, 0; glVertex $px + $w, $py;
679 elmex 1.2 glEnd;
680     }
681     }
682     }
683    
684     glDisable GL_TEXTURE_2D;
685     glDisable GL_BLEND;
686     }
687    
688 root 1.16 my %DIR = (
689     SDLK_KP8, [1, "north"],
690 root 1.18 SDLK_KP9, [2, "northeast"],
691 root 1.16 SDLK_KP6, [3, "east"],
692     SDLK_KP3, [4, "southeast"],
693     SDLK_KP2, [5, "south"],
694     SDLK_KP1, [6, "southwest"],
695     SDLK_KP4, [7, "west"],
696     SDLK_KP7, [8, "northwest"],
697 root 1.18
698     SDLK_UP, [1, "north"],
699     SDLK_RIGHT, [3, "east"],
700     SDLK_DOWN, [5, "south"],
701     SDLK_LEFT, [7, "west"],
702 root 1.16 );
703    
704     sub key_down {
705     my ($self, $ev) = @_;
706    
707     my $mod = $ev->key_mod;
708     my $sym = $ev->key_sym;
709    
710     if ($sym == SDLK_KP5) {
711     $::CONN->send ("command stay fire");
712     } elsif (exists $DIR{$sym}) {
713     if ($mod & KMOD_SHIFT) {
714 root 1.18 $self->{shft}++;
715 root 1.16 $::CONN->send ("command fire $DIR{$sym}[0]");
716     } elsif ($mod & KMOD_CTRL) {
717 root 1.18 $self->{ctrl}++;
718 root 1.16 $::CONN->send ("command run $DIR{$sym}[0]");
719     } else {
720 root 1.18 $::CONN->send ("command $DIR{$sym}[1]");
721 root 1.16 }
722     }
723     }
724    
725     sub key_up {
726     my ($self, $ev) = @_;
727    
728     my $mod = $ev->key_mod;
729     my $sym = $ev->key_sym;
730    
731 root 1.18 if (!($mod & KMOD_SHIFT) && delete $self->{shft}) {
732     $::CONN->send ("command fire_stop");
733     }
734     if (!($mod & KMOD_CTRL ) && delete $self->{ctrl}) {
735     $::CONN->send ("command run_stop");
736 root 1.16 }
737     }
738    
739 elmex 1.1 1;
740 root 1.5