[HTC Sensation] jjdoctor:
It is Possible to take picture with Volume Rocker but then you have to Assign Camera app to Volume rocker key and it will disable Volume key function all in all. You can use volume button then to Open Camera application and Take Pictures.

But thats not we want..

I have spent lots of Hours finding the exact sequence.. in HTCCamera.smali I found few lines that can be changed but cant do it since I am not professional.

Here is the code..

.method public onKeyDown(ILandroid/view/KeyEvent;)Z
.registers 11
.parameter "keyCode"
.parameter "event"

.prologue
const/4 v7, 0x0

const/4 v6, 0x1

.line 1530
iget-object v4, p0, Lcom/android/camera/HTCCamera;->prefs:Landroid/content/SharedPreferences;

const-string v5, "search_shutter_enabled"

invoke-interface {v4, v5, v7}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

move-result v0

.line 1531
.local v0, searchShutter:Z
iget-object v4, p0, Lcom/android/camera/HTCCamera;->prefs:Landroid/content/SharedPreferences;

const-string v5, "vol_up_shutter_enabled"

invoke-interface {v4, v5, v7}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

move-result v2

.line 1532
.local v2, volUpShutter:Z
iget-object v4, p0, Lcom/android/camera/Camera;->prefs:Landroid/content/SharedPreferences;

const-string v5, "vol_down_shutter_enabled"

invoke-interface {v4, v5, v7}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

move-result v1

.line 1533
.local v1, volDownShutter:Z
iget-object v4, p0, Lcom/android/camera/HTCCamera;->prefs:Landroid/content/SharedPreferences;

const-string v5, "vol_zoom_enabled"

invoke-interface {v4, v5, v7}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z

move-result v3

.line 1535
.local v3, volZoom:Z
sparse-switch p1, :sswitch_data_c0

.line 1595
invoke-super {p0, p1, p2}, Lcom/android/camera/BaseCamera;->onKeyDown(ILandroid/view/KeyEvent;)Z

move-result v4

:goto_29
return v4

.line 1537
:sswitch_2a
iget-boolean v4, p0, Lcom/android/camera/HTCCamera;->mFirstTimeInitialized:Z

if-eqz v4, :cond_37

invoke-virtual {p2}, Landroid/view/KeyEvent;->getRepeatCount()I

move-result v4

if-nez v4, :cond_37

.line 1538
invoke-direct {p0, v6}, Lcom/android/camera/HTCCamera;->doFocus(Z)V

:cond_37
move v4, v6

.line 1540
goto :goto_29

.line 1542
:sswitch_39
iget-boolean v4, p0, Lcom/android/camera/HTCCamera;->mFirstTimeInitialized:Z

if-eqz v4, :cond_46

invoke-virtual {p2}, Landroid/view/KeyEvent;->getRepeatCount()I

move-result v4

if-nez v4, :cond_46

.line 1543
invoke-direct {p0}, Lcom/android/camera/HTCCamera;->doSnap()V

:cond_46
move v4, v6

.line 1545
goto :goto_29

.line 1547
:sswitch_48
if-eqz v0, :cond_4f

.line 1548
iget-object v4, p0, Lcom/android/camera/HTCCamera;->prefs:Landroid/content/SharedPreferences;

invoke-direct {p0, v4, p2}, Lcom/android/camera/Camera;->doShutter(Landroid/content/SharedPreferences;Landroid/view/KeyEvent;)Z

:cond_4f
move v4, v6

.line 1550
goto :goto_29

.line 1552
:sswitch_51
if-eqz v2, :cond_5d

iget-object v4, p0, Lcom/android/camera/HTCCamera;->prefs:Landroid/content/SharedPreferences;

invoke-direct {p0, v4, p2}, Lcom/android/camera/HTCCamera;->doShutter(Landroid/content/SharedPreferences;Landroid/view/KeyEvent;)Z

move-result v4

if-eqz v4, :cond_5d

move v4, v6

.line 1553
goto :goto_29

.line 1556
:cond_5d
if-eqz v3, :cond_67

invoke-direct {p0, v6}, Lcom/android/camera/HTCCamera;->doVolZoom(Z)Z

move-result v4

if-nez v4, :cond_67

move v4, v7

.line 1557
goto :goto_29

:cond_67
move v4, v6

.line 1560
goto :goto_29

.line 1562
:sswitch_69
if-eqz v1, :cond_75

iget-object v4, p0, Lcom/android/camera/HTCCamera;->prefs:Landroid/content/SharedPreferences;

invoke-direct {p0, v4, p2}, Lcom/android/camera/HTCCamera;->doShutter(Landroid/content/SharedPreferences;Landroid/view/KeyEvent;)Z

move-result v4

if-eqz v4, :cond_75

move v4, v6

.line 1563
goto :goto_29

.line 1566
:cond_75
if-eqz v3, :cond_7f

invoke-direct {p0, v7}, Lcom/android/camera/HTCCamera;->doVolZoom(Z)Z

move-result v4

if-nez v4, :cond_7f

move v4, v7

.line 1567
goto :goto_29

:cond_7f
move v4, v6

.line 1570
goto :goto_29

.line 1572
:sswitch_81
iget-object v4, p0, Lcom/android/camera/HTCCamera;->prefs:Landroid/content/SharedPreferences;

invoke-virtual {p0, v4}, Lcom/android/camera/HTCCamera;->powerShutter(Landroid/content/SharedPreferences;)Z

move-result v4

if-eqz v4, :cond_8c

.line 1573
invoke-direct {p0, v6}, Lcom/android/camera/HTCCamera;->doFocus(Z)V

:cond_8c
move v4, v6

.line 1575
goto :goto_29

.line 1579
:sswitch_8e
iget-boolean v4, p0, Lcom/android/camera/Camera;->mFirstTimeInitialized:Z

if-eqz v4, :cond_b7

invoke-virtual {p2}, Landroid/view/KeyEvent;->getRepeatCount()I

move-result v4

if-nez v4, :cond_b7

.line 1583
iget-object v4, p0, Lcom/android/camera/HTCCamera;->mHeadUpDisplay:Lcom/android/camera/ui/HeadUpDisplay;

invoke-virtual {v4}, Lcom/android/camera/ui/HeadUpDisplay;->collapse()Z

move-result v4

if-eqz v4, :cond_a2

move v4, v6

goto :goto_29

.line 1584
:cond_a2
invoke-direct {p0, v6}, Lcom/android/camera/HTCCamera;->doFocus(Z)V

.line 1585
iget-object v4, p0, Lcom/android/camera/Camera;->mShutterButton:Lcom/android/camera/ShutterButton;

invoke-virtual {v4}, Lcom/android/camera/ShutterButton;->isInTouchMode()Z

move-result v4

if-eqz v4, :cond_ba

.line 1586
iget-object v4, p0, Lcom/android/camera/HTCCamera;->mShutterButton:Lcom/android/camera/ShutterButton;

invoke-virtual {v4}, Lcom/android/camera/ShutterButton;->requestFocusFromTouch()Z

.line 1590
:goto_b2
iget-object v4, p0, Lcom/android/camera/HTCCamera;->mShutterButton:Lcom/android/camera/ShutterButton;

invoke-virtual {v4, v6}, Lcom/android/camera/ShutterButton;->setPressed(Z)V

:cond_b7
move v4, v6

.line 1592
goto/16 :goto_29

.line 1588
:cond_ba
iget-object v4, p0, Lcom/android/camera/HTCCamera;->mShutterButton:Lcom/android/camera/ShutterButton;

invoke-virtual {v4}, Lcom/android/camera/ShutterButton;->requestFocus()Z

goto :goto_b2

.line 1535
:sswitch_data_c0
.sparse-switch
0x17 -> :sswitch_8e
0x18 -> :sswitch_51
0x19 -> :sswitch_69
0x1a -> :sswitch_81
0x1b -> :sswitch_39
0x50 -> :sswitch_2a
0x54 -> :sswitch_48
.end sparse-switch
.end method