Browse Source

Added Home/End key to editw and readw.

develop
DF6FR 15 years ago
parent
commit
a674f069a4
  1. 24
      yfksubs.pl

24
yfksubs.pl

@ -974,6 +974,18 @@ sub readw {
if ($strpos < length($input)) { $strpos++ }
}
elsif ($ch eq KEY_HOME) { # Pos1 key
$pos = 0;
$strpos = 0;
}
elsif ($ch eq KEY_END) { # End key
$strpos = length($input);
if ($strpos >= $strlen) {$strpos = $strlen-1;}
$pos = $strpos;
if ($pos >= $width) {$pos = $width-1;}
}
elsif (($ch eq KEY_DC) && ($strpos < length($input))) { # Delete key
$input = substr($input, 0, $strpos).substr($input, $strpos+1, );
}
@ -4130,6 +4142,18 @@ sub editw {
if ($strpos < length($input)) { $strpos++ }# go right if possible
}
elsif ($ch eq KEY_HOME) { # Pos1 key
$pos = 0;
$strpos = 0;
}
elsif ($ch eq KEY_END) { # End key
$strpos = length($input);
if ($strpos >= $strlen) {$strpos = $strlen-1;}
$pos = $strpos;
if ($pos >= $width) {$pos = $width-1;}
}
elsif (($ch eq KEY_DC) && ($strpos < length($input))) { # Delete key
$input = substr($input, 0, $strpos).substr($input, $strpos+1, );
}

Loading…
Cancel
Save