[Touch Pro, Fuze Android Development] denis1984:
Reconfiguring hardware buttons on HTC Touch Diamond

1. Power Button

* Press: Show notification section, and wakes up the phone.

4. Home Button

* Press: Show home

* Hold: Bring up recent applications

8. Center Button

* Press: Show options, and wakes up the phone.

* Hold: Show keyboard

Only power button and center button will wake up the phone.

You will want to add 'physkeyboard=diam100' and 'board-htcraphael-navi.wake=1' for the above to work to the haret startup.txt script which is pretty straightforward.

Here is the keymap file I prepared for my HTC Touch Diamond:

# HTC Touch Diamond [DIAM100] by Denis Valeev [denis.valeev@gmail.com]

#WAKE_DROPPED - just wake up if the device is sleeping
#WAKE - wake up and perform assigned operation

# code function pre-function # description
###################
key 139 HOME	# home icon

key 102 NOTIFICATION WAKE_DROPPED	# power icon
key 158 BACK	# back icon
key 107 ENDCALL	# end call icon
key 231 CALL	# call icon

key 232 MENU WAKE_DROPPED	# central navigation button

key 108 DPAD_DOWN	# bottom navigation button
key 103 DPAD_UP	# top navigation button
key 105 DPAD_LEFT	# left navigation button
key 106 DPAD_RIGHT	# right navigation button

key 115 VOLUME_UP	# volume up button
key 114 VOLUME_DOWN	# volume down button

I have attached this diam100_keymap.zip file and you need to extract it to the /init.etc/keymaps/ folder and also modify the android /init script to be able to read 'physkeyboard=diam100' option that we specify in our startup.txt.

Like so:

elif /bin/grep -c 'physkeyboard=diam100' /proc/cmdline >/dev/null ; then
echo "USING DIAM100 LAYOUT"
cp -f /init.etc/keymaps/diam100_microp-keypad.kcm.bin /etc/keymaps/microp-keypad.kcm.bin
cp -f /init.etc/keymaps/diam100_microp-keypad.kl /etc/keymaps/microp-keypad.kl
cp -f /init.etc/keymaps/diam100_navi_pad.kl /etc/keymaps/raph_navi_pad.kl

this is a simple copycat with a few modifications to take care of the filename and message differences.

All of that, I suspect, should be added to our repository to streamline these settings in further releases. I just ask the devs to put it in there for the folks to use.

On a side note, I know you guys are too set in your ways as to changing the all too convenient functions set to buttons, but I, for one, find it too difficult to use this power button, for example, to show desktop, that's just plain wrong because you need to do an extra effort to reposition your grasp on the phone and click it with your forefinger, keeping in mind the fact that in best case scenario you're operating the phone with your holding hand. But with these settings you only need to press "home button" to go home. :) Also, turning on the phone with the central button is a dream come true in my opinion, for the same simple reasons: too damn hard to press that power button.

Accessing filesystem and terminal wirelessly

I couldn't manage to tether my phone to the laptop that I use via USB even though I think I followed the instructions closely as to the way I should do that. So instead, I use SwiFTP server to run on my phone and then I access it thru wifi, connecting to the local ip address and using an ftp client on my machine I can copy files to and from the phone which is nice, because you ain't need no wires.

Also, I use Putty to access the shell on the phone via SSH protocol and with the dropbear daemon running on the phone to simplify executing various scripts. And I use that with this db.sh script put into /system/xbin folder:

IP=`busybox ifconfig tiwlan0 |grep addr |cut -f 2 -d ":" |cut -f 1 -d " " |grep "."|cut -f 1 -d " " |grep -v Ethernet`
dropbear -a -N root -U 0 -G 0 -C password -p $IP:22
echo "Dropbear started with IP:"$IP

Which runs the dropbear daemon with user-password security policy. And before running that, you need to generate keys (just google about that).

Bugs that I found and I know that you probably know about them, but let's just reiterate them again for posterity :)

* Under certain conditions, especially when you switch on and off the wifi using this Power Control widget, I can experience these capacitive buttons to work in an incorrect way, to the point where I no longer can manage the phone to switch off with the End Call button. The LED shows, for example, that the back key being touched on and I can't _swipe_ that away from there, but sometimes "swiping" works and the key unsticks. Whatever that means.

That's a real pain in the ass, anyways.

* Wifi operates constantly at max speed, which makes the phone unpleasantly hot. We should implement some sleeping policy in here. I know, captain obvious in the house.

* USSD messages from my Russian operator are gibberish. That's a minor bug and perhaps has nothing to do with the porting community.

* Turning on the phone and unlocking it, if you know how to do that, won't take longer than, say, 4 seconds. Now, that's cool. But the real problem here is that display won't wake up when the device is awake until after you hit that unlocking button (or one of those unlocking areas in case you're using the pattern to unlock your phone). I guess that has something to do with the gradual dimming and undimming of the screen, which is BTW accompanied by a lot of debug messages which you can see in the OSMonitor, and deep sleep.

* Camera. Now, I can live without that one for a long time. :) But playing with this Google Goggle app might pique the interest of a lot of people out there in this project.