LCD.pm |
my %lcd_keymap1 = ( N => 'up', I => 'down', M => 'left', H => 'right', F => 'exit', K => 'enter', L => 'left', G => 'right');
my %lcd_keymap2 = ( 38=> 'up', 40=> 'down', 37=> 'left', 39=> 'right', 17=> 'exit', 96=> 'enter') ;
$lcd1 = new LCD 'lcdproc', '192.168.0.5:13666', '4x20', 'default', \%lcd_keymap1;
$lcd2 = new LCD 'keyboard', undef, '4x20', 'mh', \%lcd_keymap2;
Send and receive data to LCD type displays with keypads
NONE
$type: Either lcdproc or keyboard.
$port: The ip:port of where lcdproc is running.
$size: ROWSxCOLUMNS of the LCD display.
$menu_group: The menu parsed by menu_parse (see Menu section of this doc).
$keymap: A has that translates keys to usable names.
start
Connect to the LCD. Automatically called on startup
stop
Disconnect the LCD.
Load menu $menu. Default menu is the first one.
check_key
Returns whatever key is keyed in
set(@data)
Sends @data to the LCD, one line per list element
set_key($key)
Simulates the keyboard being pressed with $key
inactive
Returns true if no key has been pressed in 10 seconds.
NONE
UNK
An example is in mh/code/bruce/lcd.pl. To use simulate an LCD keypad with your pc keyboard, use mh/code/bruce/lcd_keyboard.pl.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
LCD.pm |