The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

AAC::Pvoice::Input - A class that handles the input that controls a pVoice-like application

SYNOPSIS

  # this module will normally not be called directly. It's called from
  # AAC::Pvoice::Panel by default

DESCRIPTION

AAC::Pvoice::Input allows one or two button operation of an AAC::Pvoice based application. The module uses Device::ParallelPort, so it should be able to run on Win32 as well as Linux platforms.

USAGE

new(panel)

This constructor takes the panel (AAC::Pvoice::Panel typically) on which the events and timer will be called as a parameter. If the configuration (read using Wx::ConfigBase::Get) has a key called 'Device' (which can be set to 'icon' or 'adremo') is set to 'adremo', it will start polling the parallel port every x milliseconds, where x is the value of the key 'Interval'. This setting is only useful if you connect an "Adremo" electrical wheelchair to the parallel port of your PC (for more information see http://www.adremo.nl).

AAC::Pvoice::Input has the ability to operate with either one or two buttons. If you want to use only one button, you need to set the configuration key "Buttons" to 1, and it will automatically invoke the subroutine you pass to Next() at an interval of the value set in the key OneButtonInterval (set in milliseconds).

The default for is to operate in two button mode, and if OneButtonInterval is not set, it will use a default of 2000 milliseconds if "Buttons" is set to 1.

Next(sub)

This method takes a coderef as parameter. This coderef will be invoked when the 'Next' event happens.

If the Device (see 'new') is set to 'icon', and a right mousebutton is clicked, a 'Next' event is generated. If the Device is set to 'adremo' and the headsupport of the wheelchair is moved to the right, that will also generate a 'Next' event.

Select(sub)

This method takes a coderef as parameter. This coderef will be invoked when the 'Select' event happens.

If the Device (see 'new') is set to 'icon', and a left mousebutton is clicked, a 'Select' event is generated. If the Device is set to 'adremo' and the headsupport of the wheelchair is moved to the left, that will also generate a 'Select' event.

Quit

This method will stop the timer that monitors the parallel port.

BUGS

probably a lot, patches welcome!

AUTHOR

        Jouke Visser
        jouke@pvoice.org
        http://jouke.pvoice.org

COPYRIGHT

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

The full text of the license can be found in the LICENSE file included with this module.

SEE ALSO

perl(1), Wx