A hook for beeping.
This commit is contained in:
parent
8f84891b0c
commit
2ea1d736b0
3 changed files with 20 additions and 3 deletions
14
plugins/beep_terminal
Executable file
14
plugins/beep_terminal
Executable file
|
@ -0,0 +1,14 @@
|
||||||
|
#!perl
|
||||||
|
|
||||||
|
sub command { NEXT }
|
||||||
|
|
||||||
|
# So you want a different beep mechanism...
|
||||||
|
#
|
||||||
|
# Don't just edit this plugin. Instead, COPY this file and add yours to
|
||||||
|
# revbank.plugins
|
||||||
|
|
||||||
|
sub hook_beep {
|
||||||
|
my ($class) = @_;
|
||||||
|
|
||||||
|
print "\a";
|
||||||
|
}
|
|
@ -7,7 +7,7 @@ sub command { NEXT }
|
||||||
sub hook_prompt_idle {
|
sub hook_prompt_idle {
|
||||||
my ($class, $cart, $plugin, $seconds, $readline) = @_;
|
my ($class, $cart, $plugin, $seconds, $readline) = @_;
|
||||||
if ($seconds >= $timeout and $cart->size and not $plugin) {
|
if ($seconds >= $timeout and $cart->size and not $plugin) {
|
||||||
$readline->ding;
|
call_hooks("beep");
|
||||||
|
|
||||||
return if $seconds > $timeout; # text only once
|
return if $seconds > $timeout; # text only once
|
||||||
|
|
||||||
|
|
|
@ -10,10 +10,13 @@ idle
|
||||||
undo
|
undo
|
||||||
give
|
give
|
||||||
take
|
take
|
||||||
nyan # fun, but not compatible with dumb terminals
|
nyan # fun, but not compatible with dumb terminals
|
||||||
pfand # makes little sense in a self service environment
|
pfand # makes little sense in a self service environment
|
||||||
stock
|
stock
|
||||||
|
|
||||||
|
beep_terminal
|
||||||
|
|
||||||
|
|
||||||
# Then, plugins that apply heuristics
|
# Then, plugins that apply heuristics
|
||||||
|
|
||||||
products # matches product IDs (barcodes)
|
products # matches product IDs (barcodes)
|
||||||
|
|
Loading…
Add table
Reference in a new issue