mirror of
https://github.com/Oibaf66/fbzx-wii.git
synced 2024-11-28 02:54:15 +01:00
VK pointer moved by joystick also when Auto VK option is on.
Fix for fast menu scrolling. VK called by wimote 1 only.
This commit is contained in:
parent
5a5bb1a737
commit
2b88934a2d
@ -1296,7 +1296,7 @@ inline void read_keyboard () {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(HW_RVL) || defined(HW_DOL)
|
#if defined(HW_RVL) || defined(HW_DOL)
|
||||||
if (!ordenador.vk_auto)
|
if (ordenador.vk_is_active)
|
||||||
{
|
{
|
||||||
int SDL_PrivateMouseMotion(Uint8 buttonstate, int relative, Sint16 x, Sint16 y);
|
int SDL_PrivateMouseMotion(Uint8 buttonstate, int relative, Sint16 x, Sint16 y);
|
||||||
if (SDL_JoystickGetAxis(ordenador.joystick_sdl[joy_n], 2) > 16384) SDL_PrivateMouseMotion(0,1,4/RATIO,0); //C-stick Horizontal axix
|
if (SDL_JoystickGetAxis(ordenador.joystick_sdl[joy_n], 2) > 16384) SDL_PrivateMouseMotion(0,1,4/RATIO,0); //C-stick Horizontal axix
|
||||||
@ -1799,11 +1799,10 @@ inline void read_keyboard () {
|
|||||||
else //Auto VK
|
else //Auto VK
|
||||||
{
|
{
|
||||||
#ifdef HW_RVL
|
#ifdef HW_RVL
|
||||||
WPADData *wd0, *wd1;
|
WPADData *wd0;
|
||||||
wd0 = WPAD_Data(0); //wiimote 0
|
wd0 = WPAD_Data(0); //wiimote 0
|
||||||
wd1 = WPAD_Data(1); //wiimote 1
|
if ((wd0->ir.valid)&&(!ordenador.vk_is_active)) virtkey_ir_activate();
|
||||||
if (((wd0->ir.valid)||(wd1->ir.valid))&&(!ordenador.vk_is_active)) virtkey_ir_activate();
|
if ((!wd0->ir.valid)&&(ordenador.vk_is_active)) virtkey_ir_deactivate();
|
||||||
if ((!wd0->ir.valid)&&(!wd1->ir.valid)&&(ordenador.vk_is_active)) virtkey_ir_deactivate();
|
|
||||||
#else //Win
|
#else //Win
|
||||||
int x=0,y=0 ;
|
int x=0,y=0 ;
|
||||||
SDL_GetMouseState(&x,&y);
|
SDL_GetMouseState(&x,&y);
|
||||||
|
@ -1167,14 +1167,11 @@ uint32_t menu_wait_key_press(int *joy_n_p)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
#if defined(HW_RVL) || defined(HW_DOL)
|
#if defined(HW_RVL) || defined(HW_DOL)
|
||||||
if (!ordenador.vk_auto)
|
|
||||||
{
|
|
||||||
int SDL_PrivateMouseMotion(Uint8 buttonstate, int relative, Sint16 x, Sint16 y);
|
int SDL_PrivateMouseMotion(Uint8 buttonstate, int relative, Sint16 x, Sint16 y);
|
||||||
if (SDL_JoystickGetAxis(ordenador.joystick_sdl[nr], 2) > 16384) SDL_PrivateMouseMotion(0,1,4/RATIO,0); //C-stick Horizontal axix
|
if (SDL_JoystickGetAxis(ordenador.joystick_sdl[nr], 2) > 16384) SDL_PrivateMouseMotion(0,1,4/RATIO,0); //C-stick Horizontal axix
|
||||||
if (SDL_JoystickGetAxis(ordenador.joystick_sdl[nr], 2) < -16384) SDL_PrivateMouseMotion(0,1,-4/RATIO,0); //C-stick Horizontal axix
|
if (SDL_JoystickGetAxis(ordenador.joystick_sdl[nr], 2) < -16384) SDL_PrivateMouseMotion(0,1,-4/RATIO,0); //C-stick Horizontal axix
|
||||||
if (SDL_JoystickGetAxis(ordenador.joystick_sdl[nr], 3) > 16384) SDL_PrivateMouseMotion(0,1,0,4/RATIO); //C-stick vertical axix
|
if (SDL_JoystickGetAxis(ordenador.joystick_sdl[nr], 3) > 16384) SDL_PrivateMouseMotion(0,1,0,4/RATIO); //C-stick vertical axix
|
||||||
if (SDL_JoystickGetAxis(ordenador.joystick_sdl[nr], 3) < -16384) SDL_PrivateMouseMotion(0,1,0,-4/RATIO); //C-stick vertical axix
|
if (SDL_JoystickGetAxis(ordenador.joystick_sdl[nr], 3) < -16384) SDL_PrivateMouseMotion(0,1,0,-4/RATIO); //C-stick vertical axix
|
||||||
}
|
|
||||||
#endif
|
#endif
|
||||||
hats = SDL_JoystickNumHats (joy);
|
hats = SDL_JoystickNumHats (joy);
|
||||||
for (i = 0; i < hats; i++) {
|
for (i = 0; i < hats; i++) {
|
||||||
@ -1240,6 +1237,7 @@ uint32_t menu_wait_key_press(int *joy_n_p)
|
|||||||
keys = 0;
|
keys = 0;
|
||||||
|
|
||||||
//Quick scrolling
|
//Quick scrolling
|
||||||
|
if (!joy_n_p) //We do not want fast scrolling with the vk
|
||||||
for (nr = 0; nr < ordenador.joystick_number; nr++) {
|
for (nr = 0; nr < ordenador.joystick_number; nr++) {
|
||||||
joy = ordenador.joystick_sdl[nr];
|
joy = ordenador.joystick_sdl[nr];
|
||||||
|
|
||||||
@ -1360,9 +1358,9 @@ static int menu_select_internal(SDL_Surface *screen,
|
|||||||
else if (keys & KEY_DOWN)
|
else if (keys & KEY_DOWN)
|
||||||
{select_next(p_menu, 0, 1, 1);play_click(0);}
|
{select_next(p_menu, 0, 1, 1);play_click(0);}
|
||||||
else if (keys & KEY_UP_FAST)
|
else if (keys & KEY_UP_FAST)
|
||||||
{select_next(p_menu, 0, -1, 1);}
|
{select_next(p_menu, 0, -1, 1);usleep(20000);}
|
||||||
else if (keys & KEY_DOWN_FAST)
|
else if (keys & KEY_DOWN_FAST)
|
||||||
{select_next(p_menu, 0, 1, 1);}
|
{select_next(p_menu, 0, 1, 1);;usleep(20000);}
|
||||||
else if (keys & KEY_PAGEUP)
|
else if (keys & KEY_PAGEUP)
|
||||||
{select_next(p_menu, 0, -19, 0);play_click(0);}
|
{select_next(p_menu, 0, -19, 0);play_click(0);}
|
||||||
else if (keys & KEY_PAGEDOWN)
|
else if (keys & KEY_PAGEDOWN)
|
||||||
|
Loading…
Reference in New Issue
Block a user