Adding delays to the 4 buttons on the EVO? - EVO 4G General

If any of you programming geniuses out there can figure out a way to add a small delay to the 4 EVO buttons a lot of folks would be very grateful.
Those buttons are just way to sensitive and are constantly getting bumped. They need a small delay (option?) to make them a little less subject to accidental triggering.

not a problem for me

i see what you mean, but honestly, i prefer them nice and fast and responsive with occasional accidents. my $0.02.

It wouldn't help I think because it's usually like part of your hand that sits over them.

yeah this is a terrible idea

I don't think it's a terrible idea... like 10-15 times a day if I am holding the phone with my right hand, in landscape mode, parts of my palm or whatever seem to activate home or search. PITA

Just to be clear, are you wanting there to be a delay in between button presses so that you don't accidentally hit the buttons multiple times when you meant to hit them once? Or do you want the buttons to require a long-press in order to activate them?

Saturn2K said:
Just to be clear, are you wanting there to be a delay in between button presses so that you don't accidentally hit the buttons multiple times when you meant to hit them once? Or do you want the buttons to require a long-press in order to activate them?
Click to expand...
Click to collapse
for me, I'd just like for the instant-press to be disabled, and make a half-long-press, of sorts. Basically, to disable accidental 'brushes,' that could activate the buttons. It's not a huge problem honestly, but it sure does make me miss having REAL buttons. I've never been a fan of capacitive buttons, like on my laptop. A real, old-fashioned button always works better.

This happens to me all the time too. I don't know if a half-long-press, short-press, or press-hold would really make any difference. I think I trigger the buttons in just about each of those ways accidentally daily. What I could see as a potential solution is a button lock app.. maybe gesture based and floats on top of any full screen apps? If only I was more cody, I would try my hand at making it..

Find the value or command that equals a long press and I can probably do it.

BuglessPete said:
Find the value or command that equals a long press and I can probably do it.
Click to expand...
Click to collapse
This is for 2.0, and it applies to hardware buttons. I'm not sure how the EVO deals with the buttons since they are capacitive touch buttons. And it may be different in 2.1 (and HTC for that matter). But it's a start:
From http://developer.motorola.com/docstools/library/Basics_of_Event_Management/
"Long Press Events
Prior to Android 2.0, detecting the long press was only available to UI elements by implementing the event listener OnLongClickListenerand registering the View with setOnLongClick(). In 2.0, support was added for a new event handler to detect long presses on hardware buttons.
Code:
@Override
public boolean onKeyLongPress(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_CALL) {
// A long press of the call key.
// Do our work, returning true to consume it. By
// returning true, the framework knows an action has
// been performed on the long press, so will set the
// canceled flag for the following up event.
return true;
}
return super.onKeyLongPress(keyCode, event);
}
The callback is triggered by any key press-and-hold. To determine what key was pressed you need to test for a specific key code."​
I believe these are all of the key codes that would be returned: http://developer.android.com/reference/android/view/KeyEvent.html
Of interest:
Code:
public static final int KEYCODE_HOME
Since: API Level 1
Constant Value: 3 (0x00000003)
Code:
public static final int KEYCODE_SEARCH
Since: API Level 1
Constant Value: 84 (0x00000054)
Code:
public static final int KEYCODE_MENU
Since: API Level 1
Constant Value: 82 (0x00000052)
Code:
public static final int KEYCODE_BACK
Since: API Level 1
Constant Value: 4 (0x00000004)

thread moved to EVO General discussion

I too would really love to see some kind of hack that allowed for customizing the delays for these buttons. Even a 1 second delay option would be great. I accidentally brush those buttons several times a day.

Related

Remapped vogue buttons - DONE

Update: http://rapidshare.com/files/265248702/zImage-08-08-09-custom
No changes on my end, just updated to today's kernel source and repatched.
Here is the better version:
After trying a variety of combinations of keys, shifting, etc...I've come up with what *I* like best. There are plenty of better ways, if I could get them to work, but I've ended up with some severe limitations:
- Can't use shift with call, end, power or camera buttons
- Can't detect long vs short keypress
So, I've disabled shifting entirely. Yes, I loose a couple keys (home and left rotate...home can be done with end if setup to do so, and I don't care about rotation that much).
Everything is the same as the default builds except:
- Power is menu instead of home
- Volume keys do volume control
- Camera is back
Included in the file is the two source files I've changed, which go in kernel/arch/arm/mach-msm
Anyone else who knows how to compile the kernel should be able to change the layout...if you need help, let me know and I'll do what I can.
----- Original post -----
I've slightly remapped the vogue's buttons.
Before we start, I want to be clear: This is a dirty hack. The buttons are not customizable. But IMHO it's better than what we have.
Just download (see above for new link) and replace your existing zImage.
All I did was swap the GPIO settings in vogue-board.h
Add this to the bottom of the file, and comment out the original #define lines near the top.
Code:
#define GPIO_VOLDN 29
#define GPIO_POWER 41
#define GPIO_VOLUP (VOGUE_GPIO_MISC5_BASE+7)
#define VOGUE_GPIO_CAM_BUTTON 42
Power and volume down switched.
Camera and volume up switched.
Power = Menu
Camera = Back
To rotate screen, use vol up + left.
To change volume, use vol up + power or camera.
For me, this will result in much less use of the volume keys, saving some wear and tear.
Hope you like it!
Edit: Seems volume down is the only key that will turn the screen back on now...will look into fixing that.
I think I'll pass. I'm sure some people will like it better, but I like the idea of my volume keys being associated with the audio volume, even if I have to use a shift-key to do it.
craig0r said:
I think I'll pass. I'm sure some people will like it better, but I like the idea of my volume keys being associated with the audio volume, even if I have to use a shift-key to do it.
Click to expand...
Click to collapse
Hopefully that will happen eventually.
This is definitely a step in the right direction though, my volume slider is starting to get pretty shaky. Its got lots of side to side movement.
grantemsley - finally something i wanted to get done for a long time, can u pls explain how you did it - this is the combination i like, seeing that i dont use the d-pad much (with a nice touch screen and all.... )
i like the d-pad - down : menu
d-pad - up : back
volume up : volume up
volume down : volume down
power : power
camera : rotate screen
pls help me customize my zImage. what do I need to package the zImage already available..
myshinynewtouch said:
grantemsley - finally something i wanted to get done for a long time, can u pls explain how you did it - this is the combination i like, seeing that i dont use the d-pad much (with a nice touch screen and all.... )
i like the d-pad - down : menu
d-pad - up : back
volume up : volume up
volume down : volume down
power : power
camera : rotate screen
pls help me customize my zImage. what do I need to package the zImage already available..
Click to expand...
Click to collapse
I like this idea, although I occasionally use the d-pad. No way to add a shift to make the d-pad still the d-pad, or use a long press or something? Or is that too complicated for the fix atm?
I should start reading about android coding.
myshinynewtouch said:
grantemsley - finally something i wanted to get done for a long time, can u pls explain how you did it - this is the combination i like, seeing that i dont use the d-pad much (with a nice touch screen and all.... )
i like the d-pad - down : menu
d-pad - up : back
volume up : volume up
volume down : volume down
power : power
camera : rotate screen
pls help me customize my zImage. what do I need to package the zImage already available..
Click to expand...
Click to collapse
This control scheme looks very appealing to me as well...+1
Grantemsley, could you post another zImage with this config?
I'm currently at work at my real job, but playing with the code a bit in between things. I'm working on rewriting this the proper way, so that I can add additional shift keys.
There are two things I need to know:
- Where is the code that controls which button(s) will turn the phone on from standby. If I remap the power button, I end up with no buttons able to turn the phone on...I basically can't continue without finding this.
- Assuming we have any 1 key as a "shift" key, and every other key is remappable, what do you think the ideal layout would be?
Note: This will never be user configurable unless someone else figures that part out...but we can compile our own kernels with our preferred layout.
myshinynewtouch said:
i like the d-pad - down : menu
d-pad - up : back
volume up : volume up
volume down : volume down
power : power
camera : rotate screen
..
Click to expand...
Click to collapse
I would vote this layout - keeping the power button as it currently is, but change the camera butto9n back to being the [alt] key for rotating, etc... just so that there were a few more options.
The d-pad up and down for back and menu respectively is what I am REALLY looking forward to.... and the volume switch back to controlling volume.
grantemsley said:
I'm currently at work at my real job, but playing with the code a bit in between things. I'm working on rewriting this the proper way, so that I can add additional shift keys.
There are two things I need to know:
- Where is the code that controls which button(s) will turn the phone on from standby. If I remap the power button, I end up with no buttons able to turn the phone on...I basically can't continue without finding this.
- Assuming we have any 1 key as a "shift" key, and every other key is remappable, what do you think the ideal layout would be?
Note: This will never be user configurable unless someone else figures that part out...but we can compile our own kernels with our preferred layout.
Click to expand...
Click to collapse
Power: Power
End: End/Power Off
D-Pad Up: Back
D-Pad Down: Menu
D-Pad Left: Rotate
D-Pad Right: ?
Camera: Shift
Shift + D-Pad: Standard D-Pad
That's how I see it being ideal.
grantemsley said:
I'm currently at work at my real job, but playing with the code a bit in between things. I'm working on rewriting this the proper way, so that I can add additional shift keys.
There are two things I need to know:
- Where is the code that controls which button(s) will turn the phone on from standby. If I remap the power button, I end up with no buttons able to turn the phone on...I basically can't continue without finding this.
- Assuming we have any 1 key as a "shift" key, and every other key is remappable, what do you think the ideal layout would be?
Note: This will never be user configurable unless someone else figures that part out...but we can compile our own kernels with our preferred layout.
Click to expand...
Click to collapse
K, I dunno where the code is, so I can't answer that... but as for my ideal layout:
- Keep Camera button as shift
- Volume key does volume (non-shifted)
- Power button is Home
- Shift-Left is "back"
- As for suspend... I dunno, maybe double-tap the power button? Or just leave it as the Red key.
As far as never being user configurable... I'm not too certain how this all fits into the kernel, but if it could be incorporated as a module rather than built into the kernel, then that could be overcome. It wouldn't be simple. We'd need a UI front-end, which would be easy enough, but the back-end would essentially have to edit the kernel source, rebuild then reload the module. And even that probably isn't possible, as I'm quite sure android doesn't include gcc.
You guys really use the dpad that little? I use it all the time while web browsing.
TheKartus said:
Power: Power
End: End/Power Off
D-Pad Up: Back
D-Pad Down: Menu
D-Pad Left: Rotate
D-Pad Right: ?
Camera: Shift
Shift + D-Pad: Standard D-Pad
That's how I see it being ideal.
Click to expand...
Click to collapse
I see a few people want to map functions to the non-shifted D-Pad. This makes no sense to me. I like having the D-Pad as a D-Pad. My ideal configuration would make my phone usable to anyone I hand it to. My biggest beef with the current key layout has nothing to do with me using the phone, as I'm used to it... but I like to show off android to people, and it's kinda lame when they can't figure out what the buttons do without me explaining. I'd like it to be simple for someone to pick up an Android Vogue and just use it. Of course, there's no button physically labeled "Menu," so the lock screen will always be confusing to them.
grantemsley said:
You guys really use the dpad that little? I use it all the time while web browsing.
Click to expand...
Click to collapse
Yeah, I used the D-Pad all the time in WinMO, but since switching to Android, I don't touch it, unless I'm playing a game or something. If it doesn't make sense to re-map the d-pad, I'm good with that. Using the camera button for back kind of makes sense, or even the shift-left combo...
If my volume rocker gets less use than currently, it's all good.
Edit: I browse using the touch screen only and it is very accurate, even zoomed out...
Also, I don't ever hand the phone over to someone else anymore, because it NEVER seems to make sense to them, but I can see Craig0rs point...
TheKartus said:
Power: Power
End: End/Power Off
D-Pad Up: Back
D-Pad Down: Menu
D-Pad Left: Rotate
D-Pad Right: ?
Camera: Shift
Shift + D-Pad: Standard D-Pad
That's how I see it being ideal.
Click to expand...
Click to collapse
I like this layout best, so that's a +1 from me. That volume toggler wasn't made for industrial use like the d-pad and I really don't use the d-pad to select items very often since I can just touch what I want.
Also, I'm glad you guys started talking about the shift key...because in all the frigging reading I've done on android over the last week, I have somehow managed to miss that the camera button is the shift key for volume toggle ["head banging on wall"].
rhorton said:
Yeah, I used the D-Pad all the time in WinMO, but since switching to Android, I don't touch it, unless I'm playing a game or something. If it doesn't make sense to re-map the d-pad, I'm good with that. Using the camera button for back kind of makes sense, or even the shift-left combo...
If my volume rockjer gets less use than currently, it's all good.
Click to expand...
Click to collapse
Going back though is a function used very commonly, it would be a pain to have to hold a shift/alt button in order to go back.
I understand people not wanting to remap the dpad, and craigOr has a point about usability.
How about something like this:
Volume Up: Up
Volume Down: Down
Power: Wake, Home
End: Suspend, End
Camera: Back, Shift?
Camera + Left: Rotate
D Pad: D Pad
Is it even possible to make the camera function as back if pressed, and a shift if held?
My ideal layout would be:
Power: single press for suspend/resume.....long press for power off menu.
Volume slider: volume
Send: single press for phone dialer.......long press for home
End: single press for end call....long press for menu
Camera: single press for back.......long press for rotate:
Dpad: dpad
Center button: single press for select.....Long press recent programs
zenulator said:
My ideal layout would be:
Power: single press for suspend/resume.....long press for power off menu.
Volume slider: volume
Send: single press for phone dialer.......long press for home
End: single press for end call....long press for menu
Camera: single press for back.......long press for rotate:
Dpad: dpad
Center button: single press for select.....Long press recent programs
Click to expand...
Click to collapse
I was under the impression that the Red key's function gets changed by android depending on whether it's in a call or not. This would cause a huge problem with your layout, as it would take a lot more work to get the menu up during a phone call.
Thus far, I do not know how to do long keypress vs short keypress.
Also, there has to be at least 1 button that is not shiftable...which will be the button used to wake up from standby (since I still haven't gotten the dev tools working right, I can't tell why shiftable keys aren't waking the device up...)
zenulator said:
My ideal layout would be:
Power: single press for suspend/resume.....long press for power off menu.
Volume slider: volume
Send: single press for phone dialer.......long press for home
End: single press for end call....long press for menu
Camera: single press for back.......long press for rotate:
Dpad: dpad
Center button: single press for select.....Long press recent programs
Click to expand...
Click to collapse
When thinking about layouts I was under the impression that we had to keep the same functions, just move them to different keys. If the power button could suspend and wake the phone, that would be ideal... but is it possible to change all the different functions around like that?

[Q] addView from a Service to top level window

I'm adding a GestureOverlayView and Button to the top level window
Code:
mWindowManager = (WindowManager)getSystemService(Context.WINDOW_SERVICE);
so both components always appear on top of every window. I'm arranging the layout programmatically then adding them (WindowManager.addView) from a Service and managing the onClickListeners from this service. The views appear as expected and the clicks are detected also.
The problem is that both the button and GestureOverlayView do not visually update correctly. The button background doesn't change (a normal button turns orange, right?) when pressed, so I ended up setting the background manually in the onTouch method with setBackgroundDrawable on both ACTION_DOWN and ACTION_UP.
The GestureOverlayView lets me draw gesture lines as usual but normally (in an Activity) when you release your finger, the yellow line is removed. For me, it isn't. What am I missing here? I kind of hacked together a fix for the button but the gesture has stumped me.

Is there an app or native program that shuts down WM?

Is there an app or native program that shuts down WM?
Long pressing the "end call" button used to shut down my Touch Pro2, but for some reason long pressing the "end talk" button now brings up the lock screen instead. I'd like to reconfigure the "end call" button using Keyboard Config and make it shut down WM.
Is there an app or native WM program that I can assign the "end talk" to to shut down the phone?
EDIT: In my OP, I used the phrase "turn off". But what I really meant was "shut down". I can turn off my device fine with the power button. What I'd like to do is to completely shut down the device, which I can't with the "end talk" button now.
Maybe this will work:
http://forum.xda-developers.com/showthread.php?t=438351
Hi, I ported winmo to an device but only not working is touch keypad buttons home, menu, back and search.... do you know maybe where is stored settings for keypad?
munjeni said:
Hi, I ported winmo to an device but only not working is touch keypad buttons home, menu, back and search.... do you know maybe where is stored settings for keypad?
Click to expand...
Click to collapse
In the registry.
The following code :
Code:
#include "stdafx.h"
#include "pm.h"
int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
SetSystemPowerState(NULL,POWER_STATE_OFF,0);
return 0;
}
merely send the device into standby, the same as tapping the power button once
Code:
SetSystemPowerState(NULL,POWER_STATE_RESET,0);
will do an immediate soft reset, but it's not that easy to totally power it off.
Likewise:
Code:
ExitWindowsEx(EWX_POWEROFF,NULL);
Doesn't work either.

[Q] onPause() by home button pressed send intent - delay

Hi
I have two activitys and have following use case:
If user presses in the first activityOne the home button, onPause() is called. In onPause() I'd like to send an intent to the second activity to launch it.
Technically it works, but there is a huge delay betwend pressing the home button and launching the activity, about 4-6 seconds. If I send the intent by any other button pressed, it switches immediately.
Is it possible to speed up the switching or is this a given android behavior?
Regards,
cloooned
its a pretty bad level of coding to start an intent when onpause is called. consider just pressing the home button of your phone to exit the app leads you to some other activity instead.
also onpause will only be called when the activity goes to background. it will take a bit of time to reach that point.
Since the key event has been removed from the home button in Android 4.x, it seems to be one of the few chances to catch the home button pressed event. One other possibility is to overwrite the launcher with the activity and change the launcher default settings, but this would go to far.
Android prohibits you from starting an activity (from an intent) within 5 seconds after the user presses the home button. All startActivity intents will be delayed and executed after this 5 second interval. It is bad practice to start a new activity when the home button is pressed since the home button is the users last resort to escape an application.

Back button close the current application ? How i can change that ?(not force close)

I made a video so you can understand it better
So ... as you can see pressing the back button close the application or something like that and pressing the home button to leave it will result in a smooth animation when re-entering it
is there a way so i can change that ? i really like the way how application open when i leave them with the home button
I can't watch the video right now, but I will assume you are not talking about long-pressing the back button.
I guess that is just how applications work. Home button let's them run in the background and back button closes them.
The only way you can change it is with xposed or a custom rom.
Edit: Changin the behavior will also take away the ability to use it for what it was intended: to go back.
You can assing it another function or disable it altogether, but either way, you will lose the back function of the button and will have to use the app integrated back buttons.
prologikus said:
I made a video so you can understand it better
So ... as you can see pressing the back button close the application or something like that and pressing the home button to leave it will result in a smooth animation when re-entering it
is there a way so i can change that ? i really like the way how application open when i leave them with the home button
Click to expand...
Click to collapse
From another source:
Back Key :
If you press Back Key, onPause(), onStop() and onDestroy() callbacks will called.
Activity will created again by system calls onCreate() callback, then onStart() and onResume() callbacks will be followed.
Home Key :
If you press Home Key, onPause() and onStop() callbacks will called.
Here Activity will restart by system calls onRestart() callback, then onStart() and onResume() callbacks will be followed.
Click to expand...
Click to collapse
The back key will quit the application while the home key will let it run. That are the main differences. That's why they act differently. If you still want it, I know that CM based roms support changing of the layout.
but how ? or how i can search ... i only found that some layout are in generic.kl but here is just a simple match up, keys with functions idk ..
OR this is writed in the app code ?

Categories

Resources