Skip to content

Commit dbba1aa

Browse files
committed
FIXED: TUI display
1 parent 5b2486b commit dbba1aa

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

lib/App/Asciio.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,8 @@ sub button_release_event
750750
{
751751
my ($self, $event) = @_ ;
752752

753+
undef $self->{DRAGGING} ;
754+
753755
my $button = $event->{BUTTON} ;
754756
my $modifiers = $event->{MODIFIERS} ;
755757

@@ -793,7 +795,6 @@ my $modifiers = $event->{MODIFIERS} ;
793795
if($self->{PREVIOUS_X} != $x || $self->{PREVIOUS_Y} != $y)
794796
{
795797
delete $self->{BINDINGS_COMPLETION} ;
796-
$self->update_display ;
797798

798799
if($self->exists_action("${modifiers}motion_notify"))
799800
{

lib/App/Asciio/Actions.pm

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ for my $action (@actions)
132132
unless ($self->{KEEP_BINDINGS_COMPLETION})
133133
{
134134
delete $self->{BINDINGS_COMPLETION} ;
135-
$self->update_display() ;
136135
}
137136

138137
delete $self->{KEEP_BINDINGS_COMPLETION} ;
@@ -171,7 +170,6 @@ for my $action (@actions)
171170
}
172171

173172
delete $self->{BINDINGS_COMPLETION} ;
174-
$self->update_display() ;
175173
}
176174
}
177175

lib/App/Asciio/Elements.pm

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -727,7 +727,7 @@ if($height < 0)
727727
$start_y -= $height ;
728728
}
729729

730-
my $is_under = 1 ;
730+
my $is_within = 1 ;
731731

732732
for my $strip (@{$element->get_stripes()})
733733
{
@@ -745,12 +745,12 @@ for my $strip (@{$element->get_stripes()})
745745
}
746746
else
747747
{
748-
$is_under = 0 ;
748+
$is_within = 0 ;
749749
last
750750
}
751751
}
752752

753-
return($is_under) ;
753+
return($is_within) ;
754754
}
755755

756756
#-----------------------------------------------------------------------------

script/tasciio

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ $asciio->setup($setup_paths) ;
4747
$asciio->set_title($title) if defined $title ;
4848

4949
STDERR->autoflush(1) ;
50+
51+
# open my $fh, ">&=", 5 or die "can't open fh 5: $!\n" ;
52+
# $fh->autoflush(1) ;
53+
# $asciio->{ACTION_VERBOSE} = sub { $counter++ ; print $fh "$counter - $_[0]\n" ; } ;
54+
5055
# $asciio->{ACTION_VERBOSE} = sub { print STDERR "\e[?25l\e[H" ."$_[0]\n" ; } ;
5156
# $asciio->{ACTION_VERBOSE} = sub { ; } ;
5257

@@ -93,17 +98,22 @@ while (1)
9398
$last_mouse_update = $float_seconds ;
9499

95100
my ($ev, $button, $line, $col) = $tk->interpret_mouse( $key );
96-
97101
my $modifiers = '' ;
98102

99103
$modifiers .= $key->modifier_ctrl ? 'C' : '0' ;
100104
$modifiers .= $key->modifier_alt ? 'A' : '0' ;
101105
$modifiers .= '0' ; # shift blocks mouse events
102106

103-
$asciio->motion_notify_event($modifiers, $button, $col - 1, $line - 1) if ($ev == 3) ; # 3 ?
104107
$asciio->motion_dragging_event($modifiers, $button, $col - 1, $line - 1) if ($ev == MOUSE_DRAG) ;
105-
$asciio->button_press_event($modifiers, $button, $col - 1, $line - 1) if ($ev == MOUSE_PRESS) ;
106-
$asciio->button_release_event($modifiers, $button, $col - 1, $line - 1) if ($ev == MOUSE_RELEASE) ;
108+
$asciio->button_press_event($modifiers, $button, $col - 1, $line - 1) if ($ev == MOUSE_PRESS) ;
109+
110+
# mmouse release or moved without a key pressed ?
111+
if ($ev == MOUSE_RELEASE)
112+
{
113+
$asciio->motion_notify_event($modifiers, $button, $col - 1, $line - 1) ;
114+
$asciio->update_display() if $asciio->{DRAGGING} ;
115+
}
116+
107117
# $asciio->button_scroll_event($modifiers, $button, $col - 1, $line - 1) if ($ev == MOUSE_???) ;
108118
}
109119
}

0 commit comments

Comments
 (0)