[EDITThis has not worked with the latest Raph Energy ROMs since around June or July or 2010[/EDIT]
I should have editted this a while back.
The cab HTC_VolumeCtl.cab should not be used, unless you don't want to use the DPad or the arrow keys.
I now just use LaunchHTCVolumeControl_1.0.CAB with Tarkim's key remapper and it works great.
--------------------------
Old stuff is below this.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
LaunchHTCVolumeControl_1.0.CAB
Install the 2 cabs attached to this post.
Run the shortcut on the Start Menu.
It is something like Shortcut to LaunchHTCVolumeControl.lnk
Now the Volume buttons will launch the HTC Volume Control
If you copy that shortcut to Windows\Start Up
It will work most of the time.
1 time out of 15 soft resets, it launched the exe before the task bar was ready.
Thanks admaximum for posting the cab with the updated HTCVolumeControl.
I tranfered the cab from the post here: http://forum.xda-developers.com/showpost.php?p=6129949&postcount=55
[EDIT]
I've learned alot on this since I started this thread.
I have made an app that launches the Volume Control by sending the Left Mouse Down / Left Mouse Up to show the taskbar.
And then it sends a message to the appropriate item.
I have learned through the process that some items may appear that are not easy to detect through the registry.
Notification Items show up here:
HKLM\System\State\Shell\Notifications
If it also exists here:
HKCU\ControlPanel\Notifications
Then it is being displayed.
But there are exceptions, such as blue tooth.
It is displayed, but is not there.
So, I added code to search a a registry section that I also added to detect this.
HKCU\Software\JVH3\LaunchHTCVolumeControl\Ignore
And I put the bluetooth code in as another key.
So now it is extendable, if other notification items are found.
Just add the key. The same way the key for bluetooth is done.
I agree that this is not the best way to launch the control, but currently, it is the only known reliable way with a Fuze using build 23541.
[/EDIT]
[ORIGINAL]
Help - HTCVolumeControl.dll - methods and parameters
See post 27 for a cab that installs an exe and shortcut to launch the volume control.
Just use a key remapper to attach to volume buttons.
I am trying to figure out how to launch the HTC Volume Control on my Fuze from C#.
I ran depends.exe on HTCVolumeControl.dll to find the methods:
VOL_Deinit
VOL_Init
VOL_Open
VOL_Close
VOL_IOControl
VOL_Read
VOL_Write
VOL_Seek
But, I have no idea what arguments they take, or what they output.
And I am not sure how to find this out.
I wrote a really small app in C# to create a windows mobile app to execute the methods.
I only tried with: VOL_Init, VOL_Open, VOL_IOControl
using System.Runtime.InteropServices;
[DllImport("HTCVolumeControl.dll")]
private static extern int VOL_Init();
[DllImport("HTCVolumeControl.dll")]
private static extern int VOL_Open();
[DllImport("HTCVolumeControl.dll")]
private static extern int VOL_IOControl();
When executing VOL_Init, it seems to do something. It makes it so the icon on the status bar will launch the Windows Mobile Volume Control instead of the HTC one and it displays a speaker icon, instead of the windows logo.
I also tried it with these import definitions:
[DllImport("HTCVolumeControl.dll")]
private static extern int VOL_Init(uint msg);
[DllImport("HTCVolumeControl.dll")]
private static extern int VOL_Open(uint msg);
[DllImport("HTCVolumeControl.dll")]
private static extern int VOL_IOControl(uint msg);
Either way I can't get the HTC Volume Control to launch by executing any of these methods.
Please help.
If we can get this to work, then any keymapper can launch the HTC Volume Control by launching an exe made like this.
Does anyone know what arguments these methods take?
And
Does anyone know what needs to be executed to start the control?
[/ORIGINAL]
Bounty For steps to launch
In case a bounty is started, this posted is reserved to document bounties offered, and paid, if a solution is posted.
Obviously there is no way to enforce a bounty, but a bounty offered and not delivered would result cause others to not trust that user in the future.
HTCVolumeControl.dll is a service DLL. So when calling the opening function you'll only get a handle to the service. The functions you posted here is the interface that every service DLL consists of.
When developing my Taskbar launcher I'm blocking the WM_LBUTTONDOWN/UP events from taskbar to launch my own stuff instead. And one guy complaint that HTC Volume control wasn't working anymore. After a little investigation I figured out that HTC Volume control is sending those messages with X=367 and Y=26 to make it launch the volume control window.
So to open HTC Volume control you simply have to call FindWindow to retrieve a handle to the status bar and then send both WM_LBUTTONDOWN and WM_LBUTTONUP with those coordinates in the LPARAM (Y in the hiword, X in the loword, or look at Remote spy to catch the "combined" value). I don't know how to use this in C# (probably the usual PInvoke: FindWindow and SendMessage?) but if you can't figure it out I'm sure someone else can help on.
To verify just open Remote Spy, select HHTaskbar and then hit the Volume up/down buttons on your phone and you should see the LBUTTON events.
RAMMANN said:
HTCVolumeControl.dll is a service DLL. So when calling the opening function you'll only get a handle to the service. The functions you posted here is the interface that every service DLL consists of.
When developing my Taskbar launcher I'm blocking the WM_LBUTTONDOWN/UP events from taskbar to launch my own stuff instead. And one guy complaint that HTC Volume control wasn't working anymore. After a little investigation I figured out that HTC Volume control is sending those messages with X=367 and Y=26 to make it launch the volume control window.
So to open HTC Volume control you simply have to call FindWindow to retrieve a handle to the status bar and then send both WM_LBUTTONDOWN and WM_LBUTTONUP with those coordinates in the LPARAM (Y in the hiword, X in the loword, or look at Remote spy to catch the "combined" value). I don't know how to use this in C# (probably the usual PInvoke: FindWindow and SendMessage?) but if you can't figure it out I'm sure someone else can help on.
To verify just open Remote Spy, select HHTaskbar and then hit the Volume up/down buttons on your phone and you should see the LBUTTON events.
Click to expand...
Click to collapse
Thank you very much for this. When I get home from work,. I'll have some things try and learn.
I have not used Remote Spy before and have only grabbed handles to Windows in desktop programming. That was about 10 years ago.
This makes greate sense, since it can be launched from the status bar.
Thanks again.
RAMMANN said:
HTCVolumeControl.dll is a service DLL. So when calling the opening function you'll only get a handle to the service. The functions you posted here is the interface that every service DLL consists of.
When developing my Taskbar launcher I'm blocking the WM_LBUTTONDOWN/UP events from taskbar to launch my own stuff instead. And one guy complaint that HTC Volume control wasn't working anymore. After a little investigation I figured out that HTC Volume control is sending those messages with X=367 and Y=26 to make it launch the volume control window.
So to open HTC Volume control you simply have to call FindWindow to retrieve a handle to the status bar and then send both WM_LBUTTONDOWN and WM_LBUTTONUP with those coordinates in the LPARAM (Y in the hiword, X in the loword, or look at Remote spy to catch the "combined" value). I don't know how to use this in C# (probably the usual PInvoke: FindWindow and SendMessage?) but if you can't figure it out I'm sure someone else can help on.
To verify just open Remote Spy, select HHTaskbar and then hit the Volume up/down buttons on your phone and you should see the LBUTTON events.
Click to expand...
Click to collapse
OK, I have coded this and am able to get the window handle and send it messages, but since the speaker that is normally visable on the same row as the clock does not launch the volume control, it doesn't quite work.
Non programatically, I must click the clock and then click the windows logo that appears. I have attached pictures.
When I send the message, the other row appears so then I can click the Windows logo. But I have not figured out what that window is. If it is HTTaskBar, then it is not responding.
Remote Spy is great. Just wish there were a way to stop and start the reading of messages and a way to capture it to a data file.
well, as I have experienced it the WM_LBUTTON* command is not used to programmatically click on the task bar and hit the icon. I think HTC Volume Control is hooked into the task bar and if receiving a special coordinate (the one I told you) it means: show it. It was reproducible on the HTC Touch Diamond, and it was also working on another device, I think Touch HD, which got a different screen resolution. So it doesn't check if you hit the coordinates of the volume icon, it only checks for the fixed coordinates. That's why it only works with this special coordinate.
The new WM 6.5 slidebar that pops up when hitting the taskbar is a different window, it's not HHTaskbar. Forget this one.
You should check again: open Remote Spy and listen to the messages of HHTaskbar. Then hit the volume up/down controls - I mean the hardware buttons of your device - and NOT hitting the taskbar. Now you should see the WM_LBUTTON* events (among many others, but those are unimportant). You need to send exactly the same and it should work.
Code to launch HTC Volume Control
I now can programatically launch the HTC Volume Control.
Code:
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] System;[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] System.Linq;[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] System.Collections.Generic;[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] System.ComponentModel;[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] System.Data;[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] System.Drawing;[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] System.Text;[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] System.Windows.Forms;[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] System.Runtime.InteropServices;[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]namespace[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] LaunchVolumeControl[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]partial[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]class[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Form1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] : [/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Form[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]{[/SIZE]
[SIZE=2][[/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]DllImport[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"coredll.dll"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])][/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]internal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]static[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]extern[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]IntPtr[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] FindWindow([/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]String[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] lpClassName, [/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]String[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] lpWindowName);[/SIZE]
[SIZE=2][[/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]DllImport[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"coredll.dll"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])][/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]static[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]extern[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] SendMessage([/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]IntPtr[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] hWnd, [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] msg, [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] wParam, [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] lParam);[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Form1()[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2]InitializeComponent();[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] button4_Click([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]object[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] sender, [/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]EventArgs[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] e)[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]IntPtr[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] hWnd = FindWindow([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"HHTaskBar"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] LParam = ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])MakeLParam(240, 40);[/SIZE]
[SIZE=2]LParam = 0x1A01BE;[/SIZE]
[SIZE=2]SendMessage(hWnd, ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])[/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]WMessages[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].WM_LBUTTONDOWN, 0, LParam);[/SIZE]
[SIZE=2]SendMessage(hWnd, ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])[/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]WMessages[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].WM_LBUTTONUP, 0, LParam);[/SIZE]
[SIZE=2]SendMessage(hWnd, ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])0x800c, 3, 0);[/SIZE]
[SIZE=2]SendMessage(hWnd, ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])0x498, 2, 0);[/SIZE]
[SIZE=2]SendMessage(hWnd, ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])0x407, 0x7c08d760, 0x0A);[/SIZE]
[SIZE=2]SendMessage(hWnd, ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])0x007, 0, 0);[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]enum[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]WMessages[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] : [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2]{ [/SIZE]
[SIZE=2]WM_LBUTTONDOWN = 0x201, [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]//Left mousebutton down [/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]WM_LBUTTONUP = 0x202, [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]//Left mousebutton up [/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]WM_LBUTTONDBLCLK = 0x203, [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]//Left mousebutton doubleclick [/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]WM_RBUTTONDOWN = 0x204, [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]//Right mousebutton down [/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]WM_RBUTTONUP = 0x205, [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]//Right mousebutton up [/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]WM_RBUTTONDBLCLK = 0x206, [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]//Right mousebutton doubleclick [/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]WM_KEYDOWN = 0x100, [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]//Key down [/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]WM_KEYUP = 0x101, [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]//Key up [/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]} [/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] MakeLParam([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] LoWord, [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] HiWord) [/SIZE]
[SIZE=2]{ [/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ((HiWord << 16) | (LoWord & 0xffff)); [/SIZE]
[SIZE=2]} [/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]}[/SIZE]
I found the remaining 4 by using remote spy. Great advice. I did that and actually figured it out before reading your last post though.
Remote Spy ultimately got me on the right track along with getting the window and sending it messages.
Such a great tool.
Thank you for your help.
It's almost 3am where I live, so I am going to get some sleep now.
Oh if you can't get it done at all! Another way you might want to try is using kbd_event() and simulate the hardware buttons (volume up/down) but I haven't tried it and I don't know which keycodes you need. Probably it's even the better solution but I just randomly figured out the WM_LBUTTON* method when working on Taskbar launcher and thought it's easy enough. 3 lines of codes, that is. Yes..... yes.... I know the kbd_event might even be a 1 liner. So I'm sorry for any irritation but I hope one of those methods finally works for you!
JVH3 said:
I now can programatically launch the HTC Volume Control.
Code:
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] System;[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] System.Linq;[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] System.Collections.Generic;[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] System.ComponentModel;[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] System.Data;[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] System.Drawing;[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] System.Text;[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] System.Windows.Forms;[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]using[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] System.Runtime.InteropServices;[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]namespace[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] LaunchVolumeControl[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]partial[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]class[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Form1[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] : [/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]Form[/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]{[/SIZE]
[SIZE=2][[/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]DllImport[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"coredll.dll"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])][/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]internal[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]static[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]extern[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]IntPtr[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] FindWindow([/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]String[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] lpClassName, [/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]String[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] lpWindowName);[/SIZE]
[SIZE=2][[/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]DllImport[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"coredll.dll"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])][/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]static[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]extern[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] SendMessage([/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]IntPtr[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] hWnd, [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] msg, [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] wParam, [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] lParam);[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] Form1()[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2]InitializeComponent();[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]private[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]void[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] button4_Click([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]object[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] sender, [/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]EventArgs[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] e)[/SIZE]
[SIZE=2]{[/SIZE]
[SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]IntPtr[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] hWnd = FindWindow([/SIZE][SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]"HHTaskBar"[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2], [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]null[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2]);[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] LParam = ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])MakeLParam(240, 40);[/SIZE]
[SIZE=2]LParam = 0x1A01BE;[/SIZE]
[SIZE=2]SendMessage(hWnd, ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])[/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]WMessages[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].WM_LBUTTONDOWN, 0, LParam);[/SIZE]
[SIZE=2]SendMessage(hWnd, ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])[/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]WMessages[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2].WM_LBUTTONUP, 0, LParam);[/SIZE]
[SIZE=2]SendMessage(hWnd, ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])0x800c, 3, 0);[/SIZE]
[SIZE=2]SendMessage(hWnd, ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])0x498, 2, 0);[/SIZE]
[SIZE=2]SendMessage(hWnd, ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])0x407, 0x7c08d760, 0x0A);[/SIZE]
[SIZE=2]SendMessage(hWnd, ([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2])0x007, 0, 0);[/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]enum[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#2b91af][SIZE=2][COLOR=#2b91af]WMessages[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] : [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]uint[/COLOR][/SIZE][/COLOR][/SIZE]
[SIZE=2]{ [/SIZE]
[SIZE=2]WM_LBUTTONDOWN = 0x201, [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]//Left mousebutton down [/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]WM_LBUTTONUP = 0x202, [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]//Left mousebutton up [/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]WM_LBUTTONDBLCLK = 0x203, [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]//Left mousebutton doubleclick [/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]WM_RBUTTONDOWN = 0x204, [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]//Right mousebutton down [/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]WM_RBUTTONUP = 0x205, [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]//Right mousebutton up [/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]WM_RBUTTONDBLCLK = 0x206, [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]//Right mousebutton doubleclick [/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]WM_KEYDOWN = 0x100, [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]//Key down [/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]WM_KEYUP = 0x101, [/SIZE][SIZE=2][COLOR=#008000][SIZE=2][COLOR=#008000]//Key up [/COLOR][/SIZE]
[/COLOR][/SIZE][SIZE=2]} [/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]public[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] MakeLParam([/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] LoWord, [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]int[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] HiWord) [/SIZE]
[SIZE=2]{ [/SIZE]
[SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]return[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2] ((HiWord << 16) | (LoWord & 0xffff)); [/SIZE]
[SIZE=2]} [/SIZE]
[SIZE=2]}[/SIZE]
[SIZE=2]}[/SIZE]
I found the remaining 4 by using remote spy. Great advice. I did that and actually figured it out before reading your last post though.
Remote Spy ultimately got me on the right track along with getting the window and sending it messages.
Such a great tool.
Thank you for your help.
It's almost 3am where I live, so I am going to get some sleep now.
Click to expand...
Click to collapse
oh! Now this looks quite lengthy. And it's only working on your current screen resolution.
RAMMANN said:
Oh if you can't get it done at all! Another way you might want to try is using kbd_event() and simulate the hardware buttons (volume up/down) but I haven't tried it and I don't know which keycodes you need. Probably it's even the better solution but I just randomly figured out the WM_LBUTTON* method when working on Taskbar launcher and thought it's easy enough. 3 lines of codes, that is. Yes..... yes.... I know the kbd_event might even be a 1 liner. So I'm sorry for any irritation but I hope one of those methods finally works for you!
Click to expand...
Click to collapse
I have it working and just posted the code to do it.
Problem is that the hardware buttons launch the ugly windows mobile volume control.
I was writing this, so that I could launch the HTC Volume Control from the volume button key presses.
I still have to add more to handle the volume button presses but that will have to wait until tomorrow to start.
Thanks again for your help.
Using Remote Spy was the key.
RAMMANN said:
oh! Now this looks quite lengthy. And it's only working on your current screen resolution.
Click to expand...
Click to collapse
The purpose is so that I can have the volume buttons launch the HTC Volume Control.
Currently it launches the ugly Windows Mobile Volume Control for all Raphael / Touch Pro / Fuze Roms that use the later 6.5.x builds such as 23529.
It does work when it's in landscape 2, so I am thinking the first 2 messages might not even be needed.
It's already working properly with Rhodium, Topez, and Leo without needing to do anything like this.
App that launches HTC Volume Control
This is really just a proof of concept app.
I wrote this for the Fuze and that is currently the only device that I know it works on.
But, the good news is that we can now launch the HTC Volume Control from code.
There are now multiple ways we can make the volume buttons launch the HTC Volume Control with this.
small exe that launches it so any existing keymapper program can launch the volume control.
exe that handles the vol up and vol down key strokes and launches it.
JVH3 said:
The purpose is so that I can have the volume buttons launch the HTC Volume Control.
Currently it launches the ugly Windows Mobile Volume Control for all Raphael / Touch Pro / Fuze Roms that use the later 6.5.x builds such as 23529.
It does work when it's in landscape 2, so I am thinking the first 2 messages might not even be needed.
It's already working properly with Rhodium, Topez, and Leo without needing to do anything like this.
Click to expand...
Click to collapse
Ah! Ok! I see! I also had the old ugly volume controls appear on my Topaz when cooking some 6.5.x on it, but I had installed S2U and it replaces the Volume control so this was fine with me.
About your approach to launch the Volume Control, I'm still wondering why it didn't work on your device with the coordinates I told you. As a result it would only be 3 simple lines of code and that's it:
FindWindow(HHTaskbar)
SendMessage(WM_LBUTTONDOWN)
SendMessage(WM_LBUTTONUP)
Like suggested in another thread ("restart Manila") you maybe should also use PostMessage instead of SendMessage to make it more stable.
RAMMANN said:
Ah! Ok! I see! I also had the old ugly volume controls appear on my Topaz when cooking some 6.5.x on it, but I had installed S2U and it replaces the Volume control so this was fine with me.
About your approach to launch the Volume Control, I'm still wondering why it didn't work on your device with the coordinates I told you. As a result it would only be 3 simple lines of code and that's it:
FindWindow(HHTaskbar)
SendMessage(WM_LBUTTONDOWN)
SendMessage(WM_LBUTTONUP)
Like suggested in another thread ("restart Manila") you maybe should also use PostMessage instead of SendMessage to make it more stable.
Click to expand...
Click to collapse
I might change that.
I did try the way you had posted with the coordinates provided.
I am using the ArkSoft taskmanage.
I'm really tired right now, but I think I remember it activating the ArkSoft task manager.
I need to go get some sleep now.
JVH3 said:
I might change that.
I did try the way you had posted with the coordinates provided.
I am using the ArkSoft taskmanage.
I'm really tired right now, but I think I remember it activating the ArkSoft task manager.
Click to expand...
Click to collapse
I see. So the guy seems to got the same problem I got. On devices on which the HTC Volume control is working (older builds?) it should have the effect, that when the user hits the Volume up/down it would launch ArkSoft instead of HTC Volume Control
JVH3 said:
I need to go get some sleep now.
Click to expand...
Click to collapse
Goodnight!
Tomorrow you can try to move ArkSoft activation area and try again. If happens what I wrote before then you can use the method I first told, ArkSoft has to fix his taskman, and finally you got a stable way to launch HTC Volume Control. if you then code the app in native C then you even got a responsive way to launch it Otherwise I could also build a small EXE and upload if you're interested.
Very interesting thread. Definitely will make a donation for who fixes this for those devices not running htcvolume in combination with wm6.5.x.
Im on a blackstone and this is the only big flaw in the new builds
I still need to do a little work.
I just noticed that it does not launch it if there are notifications, such as new email.
Instead it launches somethign else.
But, after dismissing the notification, then it works.
i noticed the slider that appears after closing the clock has an extra icon on it.
So, I probably need to send message left mouse down.
and then move mouse left maybe 100px, since it will stop.
this assumes notifications are always to the left of the volume (windows logo) icon.
I think this will work, but I am at work.
I think you are going crazy this way. I still suggest: try the original commands I told you. If Arcsoft is launching instead, move the activation area somewhere else. I'm pretty sure you get HTC Volume Control launch properly (and simple).
RAMMANN said:
I think you are going crazy this way. I still suggest: try the original commands I told you. If Arcsoft is launching instead, move the activation area somewhere else. I'm pretty sure you get HTC Volume Control launch properly (and simple).
Click to expand...
Click to collapse
I will try when I get home. I am at work for a little while longer.
My activation area for ArkSwitch is the upper left and it's not that big.
When you did this, were you using a later build of Windows, such as 23529, 23518, etc.
It has been a problem with all 6.5.1, 6.5.3, and 6.5.5 ROMs where the volume buttons won't launch the HTC Volume control.
The TaskBar with these builds changed. It's not as tall.
Only recently were they able to get these to work, by using packages from a Leo. But they did not get it to work for anything other than Rhodium, Topaz, and Leo.
I will still try.
If I manually launch the Volume Control, I must click on the clock, and then click on the windows logo in the notification region that drops down, as described in the post with the pictures.
So, I would expect that I would need 2 sets of messages for each click.
Unless the specifc 1 pixel will trigger it. But since this task bar is not the same taskbar as with Windows Mobile 6.1 or 6.5, the behavior may be different.
It will be at least an hour before I get to this.
Change to original suggestion did not work
staticvoid Main(string[] args)
{
IntPtr hWnd = FindWindow("HHTaskBar", null);
uint LParam = (uint)MakeLParam(367, 26);
SendMessage(hWnd, (uint)WMessages.WM_LBUTTONDOWN, 0, LParam);
SendMessage(hWnd, (uint)WMessages.WM_LBUTTONUP, 0, LParam);
}
It just makes it show the larger Notification region like I showed in the post with the picture.
I killed ArkSwitch, QuickMenu, and ChangeScreen before testing.
I am going to try several variants of the y coordinate, since the taskbar is shorter in 6.5.5 that 6.1 and 6.5.
I tried with all y coordinate betweed 0 to 36 with x fixed at 367.
This method does not appear to work for Windows Mobile 6.5.5
I will return to my original way and add the additional messages for a moues move to the left.
I don't know about everyone else but I would love to see apps that support our Nook's hardware buttons for scrolling and turning pages. I created an small app just to find out exactly what these buttons were. I have attached the test apk and the source for it.
The buttons generate a KeyEvent that can be captured in the normal manner for handling key presses.
Left top button - 92
Left bottom button - 93
Right top button - 94
Right bottom button - 95
All the developer has to do is test for those in addition to whatever they are already monitoring for. I am going to begin emailing developers with this information and see if I get any "takers". I have emailed the following and will post a status here if I hear back:
Kindle - 5/16: Received an email saying the suggestion would be forwarded on to the appropriate development group
NewsRob (via google group) - 5/16: The developer is going to add page up/down and article up/down support!
FeedR - 5/16: Email sent
Aldiko - 5/16: Email sent
FBReader - 5/16: Email sent
In addition I am going to add hardware button support to some open source apps. I have located a number of open source RSS apps:
http://code.google.com/p/feedgoal/
http://code.google.com/p/feeddroid/
http://code.google.com/p/reader/
As an example of what we can do I have attached an updated FeedGoal where I have added support for the hardware buttons to scroll up and down on a feed article.
Update 5/17/2011:
I have modified the Browser from the stock Eclair to support page buttons and compiled it. When I try to start it on the Nook it comes up and then shuts down. One of the times I saw a "signing in" box. My thoughts is that it is trying to do something that requires gapps on the phone? If anyone has any ideas I'd be glad to try them.
* Reserved
Keys are actually
key 407 RIGHT_NEXTPAGE
key 412 LEFT_NEXTPAGE
key 139 LEFT_PREVPAGE
key 158 RIGHT_PREVPAGE
xboxexpert said:
Keys are actually
key 407 RIGHT_NEXTPAGE
key 412 LEFT_NEXTPAGE
key 139 LEFT_PREVPAGE
key 158 RIGHT_PREVPAGE
Click to expand...
Click to collapse
Those numbers are the scancodes from the keymap file TWL4030_Keypad.kl. If you are wanting to watch for key inputs in an Android application you override the "onKeyDown(int keyCode, KeyEvent event)" method and the "int keycode" that get's printed out is 92-95.
The format of the keymap file (TWL4030_Keypad.kl) is "key SCANCODE KEYCODE [FLAGS...]". In your example 407 is the SCANCODE and "RIGHT_NEXTPAGE" is the KEYCODE. The numerical value of "RIGHT_NEXTPAGE" is either 94 or 95 depending on how you set your Nook up.
If someone wants give the two attached apk's and test and verify (I've already ran them myself) that they do work as intended that would be great.
- The TouchTest should print out 92-95 (keycode) on the screen when you press them.
- The FeedGoal should page up and down when you press the right or left side keys. I may go back and change the left side to be page up/down and the right side to be article back/forward.
ReadItLater
I add a ticket to ReaditLater Support Forum.
http://support.readitlaterlist.com/...droid-support-for-nook-touch-hardware-buttons
update:
i contact the dev of electrodroid, too
are there new answers from the devs?
If you remaps two keys to VOLUME_UP and VOLUME_DOWN, almost all reading-centric programs work will hardware buttons. I have tested:
Read It Later
Kindle
Aldiko
FBreader
CoolReader
Moon+Reader
RSSdaemon
NewsRob
BuzzBox RSS reader
They all works with remapped buttons.
aruangra said:
If you remaps two keys to VOLUME_UP and VOLUME_DOWN, almost all reading-centric programs work will hardware buttons.
Click to expand...
Click to collapse
yes, of course.
but this is just a workaround and i already recognized that there are situations where i have to take the nook in the other hand to turn a page...
for example: i use the left keys remapped to volume for readitlater, so i can only use the right keys on the default reader app (which i prefer).
i think for some apps you will always have to do this remapping, especially for the kindle app in my thougts.
and it seems to me that the devs will easily can integrate this buttons in their apps.
a lot of other apps are already working with the default mapping:
e-mail
twicca
titanium backup
root explorer
alogcat
autostarts
moon+
...
Is there no way to remap the hardware buttons using like a driver software (sorry, completely noob regarding android software). Remapped buttons would help on repligo and ezpdf, my preferred readers.
I liked seeing the NewsRob support in the change log. But it only scrolls half a page down so you have to hit it twice.
I found that my old technique of remapping the key to SPACE worked better; SPACE is a page-down shortcut for most WebView apps. Unfortunately my SHIFT SPACE mapping in the layout file seemed to ignore the shift part. :-(
Android 3.0 adds real page up/down keys finally, so more apps should support the keycodes then. This isn't just a Nook issue; I've been trying to fix this on my Galaxy Tab too.
I blame Apple for not including a page down function because it's so "cool" to flick the screen around. Hope you have good timing.
Good news, everyone!
This weekend I received reply from FBReader authors. Here is the translation:
Since version 1.1.3 FBReader is able to read external file with actions mapped to keys. One can put keymap.xml file into main directory, which is /sdcard/Books by default.
File format can be seen in example:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<keymap>
<binding key="4" action="cancelMenu"/>
<binding key="23" action="processHyperlink"/>
<binding key="24" action="volumeKeyScrollBackward"/>
<binding key="25" action="volumeKeyScrollForward"/>
<binding key="66" action="processHyperlink"/>
</keymap>
All possible actions are here:
Code:
String SHOW_LIBRARY = "library";
String SHOW_PREFERENCES = "preferences";
String SHOW_BOOK_INFO = "bookInfo";
String SHOW_TOC = "toc";
String SHOW_BOOKMARKS = "bookmarks";
String SHOW_NETWORK_LIBRARY = "networkLibrary";
String SWITCH_TO_NIGHT_PROFILE = "night";
String SWITCH_TO_DAY_PROFILE = "day";
String SEARCH = "search";
String FIND_PREVIOUS = "findPrevious";
String FIND_NEXT = "findNext";
String CLEAR_FIND_RESULTS = "clearFindResults";
String SET_TEXT_VIEW_MODE_VISIT_HYPERLINKS = "hyperlinksOnlyMode";
String SET_TEXT_VIEW_MODE_VISIT_ALL_WORDS = "dictionaryMode";
String TURN_PAGE_BACK = "previousPage";
String TURN_PAGE_FORWARD = "nextPage";
String VOLUME_KEY_SCROLL_FORWARD = "volumeKeyScrollForward";
String VOLUME_KEY_SCROLL_BACK = "volumeKeyScrollBackward";
String SHOW_MENU = "menu";
String SHOW_NAVIGATION = "navigate";
String GO_BACK = "goBack";
String EXIT = "exit";
String SHOW_CANCEL_MENU = "cancelMenu";
String ROTATE = "rotate";
String INCREASE_FONT = "increaseFont";
String DECREASE_FONT = "decreaseFont";
String PROCESS_HYPERLINK = "processHyperlink";
String SELECTION_SHOW_PANEL = "selectionShowPanel";
String SELECTION_HIDE_PANEL = "selectionHidePanel";
String SELECTION_CLEAR = "selectionClear";
String SELECTION_COPY_TO_CLIPBOARD = "selectionCopyToClipboard";
String SELECTION_SHARE = "selectionShare";
String SELECTION_TRANSLATE = "selectionTranslate";
String SELECTION_BOOKMARK = "selectionBookmark";
Program must be restarted in order to pick up changes in config file.
Can anyone test if this really works? I can't test it right now.
And, I suggest to make a donation to this wonderful program authors.
Cheers.
Great news!
If other developers would do the same, we'd be in heaven.
I'll only be able to try it tomorrow, but I'll inform as soon as I do it.
DenisTheMenace said:
Good news, everyone!
This weekend I received reply from FBReader authors. Here is the translation:
Since version 1.1.3 FBReader is able to read external file with actions mapped to keys. One can put keymap.xml file into main directory, which is /sdcard/Books by default.
Program must be restarted in order to pick up changes in config file.
Can anyone test if this really works? I can't test it right now.
Click to expand...
Click to collapse
Thanks! It works very nicely with FBReader. My keymap.xml file:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<keymap>
<binding key="92" action="nextPage"/>
<binding key="93" action="previousPage"/>
<binding key="94" action="nextPage"/>
<binding key="95" action="previousPage"/>
</keymap>
Does anyone know the key number of the Nook button? It's quite useless for FBReader and it would be nice to remap it to some other function. Thanks!
Anyone thought of trying to create a service that'd catch the button presses outside of the stock apps that'd then send the right command for whatever. For example if you press the page forward button or page backward button in stock apps it'd function as designed. If you push it somewhere else like within your custom launcher or another app it'd perform as menu/home/back whatever
GabrialDestruir said:
Anyone thought of trying to create a service that'd catch the button presses outside of the stock apps that'd then send the right command for whatever. For example if you press the page forward button or page backward button in stock apps it'd function as designed. If you push it somewhere else like within your custom launcher or another app it'd perform as menu/home/back whatever
Click to expand...
Click to collapse
Yes for remapping the n-button. See this post. But still haven't had the time to do it. Too busy with work.
GabrialDestruir said:
Anyone thought of trying to create a service that'd catch the button presses outside of the stock apps that'd then send the right command for whatever. For example if you press the page forward button or page backward button in stock apps it'd function as designed. If you push it somewhere else like within your custom launcher or another app it'd perform as menu/home/back whatever
Click to expand...
Click to collapse
I've started working on exactly this during this weekend. I have so far succeeded in creating service that runs in the background and makes the upper left button a "HOME" button - meaning it shows the home activity of your choice rather than the built in menu like the n button. I'll be glad to give more technical details on what I have learned so far (when I have time, probably next weekend).
In the mean time, I would like input from other users as to some specifics on how it should work.
Here is my current vision:
- Have option to start the service manually or automatically start at boot (currently hard coded to start a boot)
- The keylayout files can remain untouched so that they still work properly for the stock applications
- the service will be aware of what Activity is in the foreground and remap purpose the buttons accordingly.
- there will be a settings Activity that lets you choose the functionality of each button on a per application basis
- the choices will to be to broadcast an Intent or to create a virtual key press (for example, my "HOME" button does not actually cause a HOME key press, but broadcasts a act...MAIN cat...HOME intent, my next experiment will be to send Vol Up/Down keys when Kindle app is running)
And this is slightly off topic, but I would like put this on sourceforge or google so that others can contribute and have easy access to it. I've never done that before, so advice on this would be appreciated.
mycr0ft said:
but I would like put this on sourceforge or google so that others can contribute and have easy access to it. I've never done that before, so advice on this would be appreciated.
Click to expand...
Click to collapse
May I suggest github? git is much more sophisticated than CVS/SVN and their clones.
I basically agree with the app functionality. May be I will take part in implementation (I wish there will be ~36-48 hours in a day )
Thanks for the advice. github looks promising.
Anyone interested can have a look:
Code:
https://github.com/mycr0ft/nook-touch-button-service
I've run into a bit of a problem with simulating a key press. The android developers have not made it easy (which is good for device security).
- I have tried Instrumentation.sendKey..., but that only works withing the same application. Even with the INJECT_EVENT permission, you cannot inject events into other applications (unless they are signed by the same packager). Repackaging every single app that you load does not sound like a good option.
- I have tried using the 'sendevent' shell command. This appears to be limited to only duplicating scan codes keys that actually exist.
- I am currently trying to compile uinput driver (available in the source code download from bn) and load it using insmod. I am stuck here for the time being because I can't figure out how to get it to compile to the right kernel version (version magic mismatch in dmesg)
I think you will need root to inject a key event in an other app
You can look at the SoftKeys source code (here), it may help you.
In the past, SoftKeys used a script called "input" to inject events (according to http://forum.xda-developers.com/showpost.php?p=10497165&postcount=309) but now it seems that it uses something else ...
mdall, thanks very much. this is very useful information.
Droid Comic Viewer
I think also Droid Comic Viewer would benefit from hardware buttons support.
It's a nice little comic reader app supporting all relevant formats (CBR, CBZ, ACV & image formats). Animations can be disabled and there's no dependency with touchscreen interface (it can be entirely operated with button actions). This would make it perfect for an e-ink screen.
I sent an email to the devs today, let's hope they get back to us!