This chapter explains how to receive events from input devices. On the Armadillo-440 LCD Model, the touch screen and buttons are supported as input devices. For the specifications of the touch screen and button drivers, refer to the "Touch Screen" and "Buttons" chapters in the "Armadillo-400 Series Software Manual."
The evtest command can be used to check what kind of input events are occurring. evtest is used as shown in 図8.1「evtest Command Format」.
For the device file to specify in place of /dev/input/eventX, refer to 表8.1「Input Device Files」.
表8.1 Input Device Files
Device File | Device |
---|
/dev/input/event0 | Buttons |
/dev/input/event1 | Touch Screen |
| |
---|
The event device file numbers are determined by the order the input devices are detected. Therefore, if another input device such as a USB keyboard is detected at boot time, the event device numbers may change. In the default Armadillo-440 LCD Model userland, the input device file name specified when starting xfbdev is fixed. Therefore if another input device such as a USB keyboard has been connected, it is possible that touch screen control will not work. To use other input devices, please connect them after booting. |
Enter Ctrl + C to stop evtest.
The swmgr command can be used to execute another command when a button is pressed.
swmgr is used as shown in 図8.2「swmgr Command Format」.
Specify the button to receive events from in place of BUTTON. For supported buttons, refer to 表8.2「Buttons Supported By swmgr」.
表8.2 Buttons Supported By swmgr
Buttons | Description |
---|
sw0 | SW1 |
sw1 | LCD_SW1 |
sw2 | LCD_SW2 |
sw3 | LCD_SW3 |
Specify the number of times to wait for an event in place of LOOP. Specify 0 for an unlimited number of times.
Specify the operation to execute when an event occurs in place of COMMAND.
The following displays time information when SW1 is pressed.
The following turns LED3 on when LCD_SW1 is pressed and turns it off when LCD_SW2 is pressed.