![]() |
#1 |
Linux Developer
![]() Posts: 5
Karma: 30
Join Date: Jan 2010
Location: Switzerland
Device: Sony PRS-505
|
Accessing the keyboard from a C++ application
Hi,
does anyone know how to access the keyboard on a PRS-505 from a C++ application (native ARM code -- not using Fsk)? All the standard ways (stdin, /dev/input/event*, /dev/input/keyboard, ...) don't seem to work... ![]() |
![]() |
![]() |
![]() |
#2 |
Linux Developer
![]() Posts: 5
Karma: 30
Join Date: Jan 2010
Location: Switzerland
Device: Sony PRS-505
|
Figured it out by looking at lsof output -- /dev/ttyDB0 seems to give direct access to the keyboard controller. However, access has to be rather fast or the tinyhttp process in the background starts eating it all up.
The controller's messages are sent in groups of 5 bytes. The first byte seems to be a message type indicator, A key press event has 0xb1 KEYCODE 0x2b in the first 3 bytes, 0xb1 KEYCODE 0x2d in the first 3 bytes is a key release event (in both cases, the 3rd byte is the key code. The 4th byte doesn't seem to have a meaning (at least for keyboard events), the 5th is a checksum (first xor last == 0xff) Any message needs to be ACK-ed or NAK-ed (or the commands are bounced back to tinyhttp once the application exits). The ACK code seems to be 0xa2 0x00 0x00 x00 0x5d, NAK seems to be 0xa3 0x00 0x00 0x00 0x5c. Last edited by bero; 01-03-2010 at 03:05 PM. Reason: Added information on ACK/NAK-ing data from the controller |
![]() |
![]() |
Advert | |
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
iPad Clarifications on Accessing PDFs Please | mvaldeslora | Apple Devices | 13 | 04-18-2010 12:29 PM |
Accessing internal and SD Storage | ramjet1953 | OpenInkpot | 2 | 02-16-2010 10:51 AM |
Accessing Gmail | kellstr | Amazon Kindle | 3 | 09-24-2008 06:22 AM |
Accessing many files on an SD card | charliearmoryco | Amazon Kindle | 8 | 01-25-2008 08:30 PM |
Mobile accessing your PC while on vacation | Colin Dunstan | Lounge | 1 | 08-02-2005 02:15 PM |