DFBTerm DirectFB Terminal Emulator

= Overview= This allows you to run a real terminal emulator on the palm pre locally. The disadvantage is that you need to stop the phone GUI first, and do a bit of setup.

These are rough notes; I plan to make this much prettier over the weekend, but of course wouldn't object if someone beats me to it.

= Install and Run= 1. Set up a debian testing chroot environment, and then chroot into it. You can use the debian stable chroot environment as a base, and then just upgrade to testing. 2. Set up directfb in the chroot. Be sure to include the "no-linux-input-grab" line in your "/etc/directfbrc" file. 3. Install build-essential, build-deps for directfb, and pkg-config 4. Compile lite - http://www.directfb.org/index.php?path=Platform%2FLiTE - and then dfbterm - http://www.directfb.org/index.php?path=Projects%2FDFBTerm - from CVS sources. Alternatively, grab .debs from http://dclark.us/palm-pre/dbfterm/ 5, In addition to the mounts listed in debian, you will also need to: mount -t devpts none /media/cf/dev/pts 6. Stop the Palm GUI /sbin/initctl stop LunaSysMgr 7. Run dfbterm dfbterm --size=50x30 or without modifying "/etc/directfbrc": dfbterm --size=50x30 --dfb:no-linux-input-grab

= Screenshot= Here is a screenshot that also describes some of the work left to do:



= TODO List=

Keyboard remapping

 * Need at least a ctrl key for this to be generally useful.
 * See notes in screenshot.

Research
> > Unicode, there's no need to recode. You could do me a favor and > > install the DirectFB-examples package and check if your keyboard is > > correctly handled by df_input. This little test application should > > show raw keyboard codes as well as the symbol associated by the kernel > > keymap. df_input --dfb:linux-input-devices=/dev/input/event2
 * loadkeys and dumpkeys: http://www.developertutorials.com/tutorials/linux/loadkeys-dumpkeys-050518/page1.html
 * Actually want to use the below command so display isn't continually updated by the acceleramator changes (/dev/input/event2 is the keyboard only).
 * How to do sticky modifier keys: https://wiki.edubuntu.org/Accessibility/doc/Guide/Mobility

event1 (keypad1) - non-keyboard keys
df_input --dfb:linux-input-devices=/dev/input/event1 Shows that: Note that if you don't tell directfb "linux-input-devices=/dev/input/event1" it won't use this keypad. Adding this line to "/etc/directfbrc" seems to make things just work (and you don't seem to need to explicitly include event2 as well, but it couldn't hurt)
 * volume up button = volume_up 115
 * volume down button = volume_down 114
 * power button = end 107
 * silver button = (not detected, but hexdump shows it is on /dev/input/event1)
 * vibrate/ring switch = (not detected, but hexdump shows it is on /dev/input/event1)

event2 (keypad0) - keyboard keys
TODO

Make use of the touchscreen

 * Make gestures do something useful.
 * See more research into mouse stuff on vala-terminal page.

Virtual Keyboard-Video-Monitor (KVM) Switch
It would be great to be able to run DirectFB applications and LunaSysMgr at the same time, and switch between them. I haven't found a way of doing this yet, but here are the possibilities I've found so far:
 * Per-process namespaces ( http://glandium.org/blog/?p=217 ) - I'm looking for a way of doing a sort of in-computer keybaord-video-monitor switch - have 2 applications that expect sole control of /dev/fb0 and /dev/input/* devices, want to be able to switch between them (with the background one just getting no i/o). This might be possible by giving each application a different /dev/fb0 and set of /dev/input/* devices, and then somehow hooking and unhooking those from the "real" devices (maybe with just like "cat").
 * v9fb - http://doc.cat-v.org/plan_9/IWP9/2008/v9fb.pdf (but can't find source code)
 * Xen Virtual Framebuffer - http://wiki.xensource.com/xenwiki/VirtualFramebuffer (see also http://sourceforge.net/projects/embeddedxen/ - Xen for ARM)
 * Port LunaSysMgr to use DirectFB and use DirectFB's support for running multiple applications (eg fusion, SaWMan)
 * http://code.google.com/p/android-vnc/ ? (not sure but looks like this might redirect display to vnc; could then access it using directvnc-rev or simular)

Prereq to most of these would be rebuilding linux from source, which is here: http://opensource.palm.com/packages.html

= Contacts= Daniel Clark  - djbclark in #webos-internals on freenode IRC.