UI::Bowdlator::Filter - Helper for specifying input filters to Bowdlator
# maps all typed characters to uppercase use UI::Bowdlator::Filter; # connect to Bowdlator server my $bowdlator = UI::Bowdlator::Filter->new() or die "Bowdlator server not online\n"; my $composed = ''; while ($bowdlator->getKey(handle_backspace => \$composed)) { if (/^[^[:graph:]]/a) { # non graphical character ends composition $bowdlator->commit(\$composed); next; } $composed .= uc; $bowdlator->suggest($composed); }
Makes writing filters for Bowdlator (http://github.com/a3f/Bowdlator) easier.
Connects to a running Bowdlator AF_UNIX socket. Returns undef on connection failure. Default socket is /usr/local/var/run/bowdlator.sock. Optionally, an actual socket or a path to one can be specified.
AF_UNIX
undef
/usr/local/var/run/bowdlator.sock
Blocks till the user types a Key while Bowdlator is selected. Accepts following optional arguments:
User code can offload backspace handling to the module. On backspace receipt, the module will discard the composed string's last character, and chop and return the one before it, so it can be rehandled. If the buffer is empty, a backspace (\b) is returned.
\b
Bowdlator sends NUL-terminated strings. The module strips them unless instructed otherwise.
The recv buffer size. This shouldn't need changing. Default is 160.
undef is returned on socket error.
Sends off a suggestion to $display and a list of @candidates to choose from. (Candidates list support not immplemented yet).
$display
@candidates
Sends off the final string to $commit. If $commit is a ref, it will be cleared.
$commit
ref
http://github.com/athreef/UI-Bowdlator-Filter
Ahmad Fatoum <athreef@cpan.org>, http://a3f.at
<athreef@cpan.org>
Copyright (C) 2016 Ahmad Fatoum
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install UI::Bowdlator::Filter, copy and paste the appropriate command in to your terminal.
cpanm
cpanm UI::Bowdlator::Filter
CPAN shell
perl -MCPAN -e shell install UI::Bowdlator::Filter
For more information on module installation, please visit the detailed CPAN module installation guide.