ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/Deliantra-Client/DC/UI.pm
(Generate patch)

Comparing deliantra/Deliantra-Client/DC/UI.pm (file contents):
Revision 1.136 by root, Wed Apr 19 20:46:44 2006 UTC vs.
Revision 1.137 by root, Wed Apr 19 21:38:05 2006 UTC

21 $FOCUS->key_up ($_[0]) if $FOCUS; 21 $FOCUS->key_up ($_[0]) if $FOCUS;
22} 22}
23 23
24sub feed_sdl_button_down_event { 24sub feed_sdl_button_down_event {
25 my ($ev) = @_; 25 my ($ev) = @_;
26 my ($x, $y) = ($ev->motion_x, $ev->motion_y); 26 my ($x, $y) = ($ev->{x}, $ev->{y});
27 27
28 if (!$BUTTON_STATE) { 28 if (!$BUTTON_STATE) {
29 my $widget = $ROOT->find_widget ($x, $y); 29 my $widget = $ROOT->find_widget ($x, $y);
30 30
31 $GRAB = $widget; 31 $GRAB = $widget;
32 $GRAB->update if $GRAB; 32 $GRAB->update if $GRAB;
33 } 33 }
34 34
35 $BUTTON_STATE |= 1 << ($ev->button - 1); 35 $BUTTON_STATE |= 1 << ($ev->{button} - 1);
36 36
37 $GRAB->button_down ($ev, $GRAB->coord2local ($x, $y)) if $GRAB; 37 $GRAB->button_down ($ev, $GRAB->coord2local ($x, $y)) if $GRAB;
38} 38}
39 39
40sub feed_sdl_button_up_event { 40sub feed_sdl_button_up_event {
41 my ($ev) = @_; 41 my ($ev) = @_;
42 my ($x, $y) = ($ev->motion_x, $ev->motion_y); 42 my ($x, $y) = ($ev->{x}, $ev->{y});
43 43
44 my $widget = $GRAB || $ROOT->find_widget ($x, $y); 44 my $widget = $GRAB || $ROOT->find_widget ($x, $y);
45 45
46 $BUTTON_STATE &= ~(1 << ($ev->button - 1)); 46 $BUTTON_STATE &= ~(1 << ($ev->{button} - 1));
47 47
48 $GRAB->button_up ($ev, $GRAB->coord2local ($x, $y)) if $GRAB; 48 $GRAB->button_up ($ev, $GRAB->coord2local ($x, $y)) if $GRAB;
49 49
50 if (!$BUTTON_STATE) { 50 if (!$BUTTON_STATE) {
51 my $grab = $GRAB; undef $GRAB; 51 my $grab = $GRAB; undef $GRAB;
54 } 54 }
55} 55}
56 56
57sub feed_sdl_motion_event { 57sub feed_sdl_motion_event {
58 my ($ev) = @_; 58 my ($ev) = @_;
59 my ($x, $y) = ($ev->motion_x, $ev->motion_y); 59 my ($x, $y) = ($ev->{x}, $ev->{y});
60 60
61 my $widget = $GRAB || $ROOT->find_widget ($x, $y); 61 my $widget = $GRAB || $ROOT->find_widget ($x, $y);
62 62
63 if ($widget != $HOVER) { 63 if ($widget != $HOVER) {
64 my $hover = $HOVER; $HOVER = $widget; 64 my $hover = $HOVER; $HOVER = $widget;
1175} 1175}
1176 1176
1177sub key_down { 1177sub key_down {
1178 my ($self, $ev) = @_; 1178 my ($self, $ev) = @_;
1179 1179
1180 my $mod = $ev->key_mod; 1180 my $mod = $ev->{mod};
1181 my $sym = $ev->key_sym; 1181 my $sym = $ev->{sym};
1182
1183 my $uni = $ev->key_unicode; 1182 my $uni = $ev->{unicode};
1184 1183
1185 my $text = $self->get_text; 1184 my $text = $self->get_text;
1186 1185
1187 if ($sym == 8) { 1186 if ($sym == 8) {
1188 substr $text, --$self->{cursor}, 1, "" if $self->{cursor}; 1187 substr $text, --$self->{cursor}, 1, "" if $self->{cursor};
1284use SDL::OpenGL; 1283use SDL::OpenGL;
1285 1284
1286sub key_down { 1285sub key_down {
1287 my ($self, $ev) = @_; 1286 my ($self, $ev) = @_;
1288 1287
1289 my $sym = $ev->key_sym; 1288 my $sym = $ev->{sym};
1290 1289
1291 if ($sym == 13) { 1290 if ($sym == 13) {
1292 $self->emit (activate => $self->get_text); 1291 $self->emit (activate => $self->get_text);
1293 $self->update; 1292 $self->update;
1294 1293

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines