… | |
… | |
53 | if ($event->{button} == $self->{data}{event}{button}) { |
53 | if ($event->{button} == $self->{data}{event}{button}) { |
54 | $self->ungrab; |
54 | $self->ungrab; |
55 | $self->destroy; |
55 | $self->destroy; |
56 | } |
56 | } |
57 | |
57 | |
|
|
58 | $self->{press}[$event->{button}] = 0; |
|
|
59 | |
58 | if ($event->{button} == 1) { |
60 | if ($event->{button} == 1) { |
59 | $self->{press}[$event->{button}] = 0; |
|
|
60 | refresh $self; |
61 | refresh $self; |
61 | |
62 | |
62 | warn "$event->{row} $event->{col}\n";#d# |
63 | warn "$event->{row} $event->{col}\n";#d# |
63 | |
64 | |
64 | if ($col >= 0 && $col < $self->ncol |
65 | if ($col >= 0 && $col < $self->ncol |
… | |
… | |
111 | sub on_start { |
112 | sub on_start { |
112 | my ($self) = @_; |
113 | my ($self) = @_; |
113 | |
114 | |
114 | # might fail, but try anyways |
115 | # might fail, but try anyways |
115 | $self->grab ($self->{data}{event}{time}, 1) |
116 | $self->grab ($self->{data}{event}{time}, 1) |
116 | and $self->allow_events_sync; |
117 | and $self->allow_events_async; |
117 | |
118 | |
118 | on_button_press $self, $self->{data}{event} if $self->{data}{event}{button}; |
119 | on_button_press $self, $self->{data}{event} if $self->{data}{event}{button}; |
119 | |
120 | |
120 | $self->cmd_parse ("\x1b[?25l\x1b[?7l"); |
121 | $self->cmd_parse ("\x1b[?25l\x1b[?7l"); |
121 | refresh $self; |
122 | refresh $self; |
… | |
… | |
126 | sub on_map_notify { |
127 | sub on_map_notify { |
127 | my ($self, $event) = @_; |
128 | my ($self, $event) = @_; |
128 | |
129 | |
129 | # should definitely not fail |
130 | # should definitely not fail |
130 | $self->grab ($self->{data}{event}{time}, 1) |
131 | $self->grab ($self->{data}{event}{time}, 1) |
131 | and $self->allow_events_sync; |
132 | and $self->allow_events_async; |
132 | } |
133 | } |
133 | |
134 | |
134 | sub on_destroy { |
135 | sub on_destroy { |
135 | } |
136 | } |
136 | |
137 | |