mirror of
https://github.com/RaySollium99/libpicofe.git
synced 2025-09-05 14:57:46 -04:00
improved autorepeat behavior in menus
git-svn-id: file:///home/notaz/opt/svn/PicoDrive/platform@499 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
2dce60fd7b
commit
6af8fee534
2 changed files with 8 additions and 4 deletions
|
@ -46,7 +46,7 @@ static int inp_prevjoy = 0;
|
|||
static unsigned long wait_for_input(unsigned long interesting)
|
||||
{
|
||||
unsigned long ret;
|
||||
static int repeats = 0, wait = 6;
|
||||
static int repeats = 0, wait = 20;
|
||||
int release = 0, i;
|
||||
|
||||
if (repeats == 2) wait = 3;
|
||||
|
@ -65,8 +65,10 @@ static unsigned long wait_for_input(unsigned long interesting)
|
|||
|
||||
if (release || ret != inp_prev) {
|
||||
repeats = 0;
|
||||
wait = 6;
|
||||
wait = 20;
|
||||
}
|
||||
if (wait > 6 && (ret&(GP2X_UP|GP2X_LEFT|GP2X_DOWN|GP2X_RIGHT)))
|
||||
wait = 6;
|
||||
inp_prev = ret;
|
||||
inp_prevjoy = 0;
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ static unsigned int inp_prev = 0;
|
|||
static unsigned long wait_for_input(unsigned int interesting, int is_key_config)
|
||||
{
|
||||
unsigned int ret;
|
||||
static int repeats = 0, wait = 6;
|
||||
static int repeats = 0, wait = 20;
|
||||
int release = 0, count, i;
|
||||
|
||||
if (!is_key_config)
|
||||
|
@ -76,12 +76,14 @@ static unsigned long wait_for_input(unsigned int interesting, int is_key_config)
|
|||
|
||||
if (release || ret != inp_prev) {
|
||||
repeats = 0;
|
||||
wait = 6;
|
||||
wait = 20;
|
||||
}
|
||||
inp_prev = ret;
|
||||
|
||||
if (!is_key_config)
|
||||
ret |= (ret & 0xf0000000) >> 24; // use analog as d-pad
|
||||
if (wait > 6 && (ret&(BTN_UP|BTN_LEFT|BTN_DOWN|BTN_RIGHT)))
|
||||
wait = 6;
|
||||
|
||||
// we don't need diagonals in menus
|
||||
if ((ret&BTN_UP) && (ret&BTN_LEFT)) ret &= ~BTN_LEFT;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue