2012-06-03 16:11:22 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 2010 EDuke32 developers and contributors
|
|
|
|
|
|
|
|
This file is part of EDuke32.
|
|
|
|
|
|
|
|
EDuke32 is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License version 2
|
|
|
|
as published by the Free Software Foundation.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
2014-07-20 08:55:56 +00:00
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2012-06-03 16:11:22 +00:00
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
2019-09-21 18:59:54 +00:00
|
|
|
#include "ns.h" // Must come before everything else!
|
|
|
|
|
2012-06-03 16:11:22 +00:00
|
|
|
#include "global.h"
|
|
|
|
#include "game.h"
|
|
|
|
#include "function.h"
|
|
|
|
#include "keyboard.h"
|
|
|
|
#include "mouse.h"
|
|
|
|
#include "joystick.h"
|
|
|
|
#include "control.h"
|
|
|
|
#include "input.h"
|
2014-12-27 18:36:58 +00:00
|
|
|
#include "menus.h"
|
2012-06-03 16:11:22 +00:00
|
|
|
|
|
|
|
int32_t I_CheckAllInput(void)
|
|
|
|
{
|
2019-08-13 09:15:49 +00:00
|
|
|
return
|
|
|
|
KB_KeyWaiting()
|
|
|
|
|| MOUSE_GetButtons()
|
|
|
|
|| JOYSTICK_GetButtons()
|
2015-04-28 21:30:42 +00:00
|
|
|
#if defined EDUKE32_IOS
|
2019-08-13 09:15:49 +00:00
|
|
|
|| g_mouseClickState == MOUSE_PRESSED
|
2015-04-28 21:30:42 +00:00
|
|
|
#endif
|
2019-08-13 09:15:49 +00:00
|
|
|
;
|
2012-06-03 16:11:22 +00:00
|
|
|
}
|
|
|
|
void I_ClearAllInput(void)
|
|
|
|
{
|
2012-11-17 16:48:11 +00:00
|
|
|
KB_FlushKeyboardQueue();
|
2012-06-03 16:11:22 +00:00
|
|
|
KB_ClearKeysDown();
|
|
|
|
MOUSE_ClearAllButtons();
|
|
|
|
JOYSTICK_ClearAllButtons();
|
2019-08-07 20:06:27 +00:00
|
|
|
CONTROL_ClearAllButtons();
|
2019-08-13 09:15:49 +00:00
|
|
|
#if defined EDUKE32_IOS
|
|
|
|
mouseAdvanceClickState();
|
|
|
|
#endif
|
2012-06-03 16:11:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2019-08-16 00:20:52 +00:00
|
|
|
int32_t I_TextSubmit(void)
|
2012-06-03 16:11:22 +00:00
|
|
|
{
|
2019-08-13 09:15:49 +00:00
|
|
|
return
|
|
|
|
KB_KeyPressed(sc_Enter)
|
|
|
|
|| KB_KeyPressed(sc_kpad_Enter)
|
2014-12-27 18:36:58 +00:00
|
|
|
#if !defined EDUKE32_TOUCH_DEVICES
|
2019-08-13 09:15:49 +00:00
|
|
|
|| MOUSEINACTIVECONDITIONAL(MOUSE_GetButtons()&LEFT_MOUSE)
|
2014-12-27 18:36:58 +00:00
|
|
|
#endif
|
2019-08-14 16:11:55 +00:00
|
|
|
|| (JOYSTICK_GetGameControllerButtons()&(1<<GAMECONTROLLER_BUTTON_A))
|
2012-06-03 16:11:22 +00:00
|
|
|
#if defined(GEKKO)
|
2019-08-13 09:15:49 +00:00
|
|
|
|| MOUSEINACTIVECONDITIONAL(JOYSTICK_GetButtons()&WII_A)
|
2012-06-03 16:11:22 +00:00
|
|
|
#endif
|
2019-08-13 09:15:49 +00:00
|
|
|
;
|
2012-06-03 16:11:22 +00:00
|
|
|
}
|
2014-06-16 23:15:49 +00:00
|
|
|
|
2019-08-16 00:20:52 +00:00
|
|
|
void I_TextSubmitClear(void)
|
2012-06-03 16:11:22 +00:00
|
|
|
{
|
2014-06-16 23:15:49 +00:00
|
|
|
KB_FlushKeyboardQueue();
|
|
|
|
KB_ClearKeyDown(sc_kpad_Enter);
|
|
|
|
KB_ClearKeyDown(sc_Enter);
|
|
|
|
MOUSE_ClearButton(LEFT_MOUSE);
|
2019-08-14 16:11:55 +00:00
|
|
|
JOYSTICK_ClearGameControllerButton(1<<GAMECONTROLLER_BUTTON_A);
|
2012-06-03 16:11:22 +00:00
|
|
|
#if defined(GEKKO)
|
2014-06-16 23:15:49 +00:00
|
|
|
JOYSTICK_ClearButton(WII_A);
|
2012-06-03 16:11:22 +00:00
|
|
|
#endif
|
|
|
|
}
|
2014-06-16 23:15:49 +00:00
|
|
|
|
2019-08-16 00:20:52 +00:00
|
|
|
int32_t I_AdvanceTrigger(void)
|
|
|
|
{
|
|
|
|
return
|
|
|
|
I_TextSubmit()
|
|
|
|
|| KB_KeyPressed(sc_Space);
|
|
|
|
}
|
|
|
|
|
|
|
|
void I_AdvanceTriggerClear(void)
|
|
|
|
{
|
|
|
|
I_TextSubmitClear();
|
|
|
|
KB_ClearKeyDown(sc_Space);
|
|
|
|
}
|
|
|
|
|
2014-06-16 23:15:49 +00:00
|
|
|
int32_t I_ReturnTrigger(void)
|
2012-06-03 16:11:22 +00:00
|
|
|
{
|
2019-08-13 09:15:49 +00:00
|
|
|
return
|
|
|
|
KB_KeyPressed(sc_Escape)
|
|
|
|
|| (MOUSE_GetButtons()&RIGHT_MOUSE)
|
2019-08-14 16:11:55 +00:00
|
|
|
|| (JOYSTICK_GetGameControllerButtons()&(1<<GAMECONTROLLER_BUTTON_B))
|
2012-06-03 16:11:22 +00:00
|
|
|
#if defined(GEKKO)
|
2019-08-13 09:15:49 +00:00
|
|
|
|| (JOYSTICK_GetButtons()&(WII_B|WII_HOME))
|
2012-06-03 16:11:22 +00:00
|
|
|
#endif
|
2019-08-13 09:15:49 +00:00
|
|
|
;
|
2012-06-03 16:11:22 +00:00
|
|
|
}
|
2014-06-16 23:15:49 +00:00
|
|
|
|
|
|
|
void I_ReturnTriggerClear(void)
|
2012-06-03 16:11:22 +00:00
|
|
|
{
|
2014-06-16 23:15:49 +00:00
|
|
|
KB_FlushKeyboardQueue();
|
|
|
|
KB_ClearKeyDown(sc_Escape);
|
|
|
|
MOUSE_ClearButton(RIGHT_MOUSE);
|
2019-08-14 16:11:55 +00:00
|
|
|
JOYSTICK_ClearGameControllerButton(1<<GAMECONTROLLER_BUTTON_B);
|
2012-06-03 16:11:22 +00:00
|
|
|
#if defined(GEKKO)
|
2014-06-16 23:15:49 +00:00
|
|
|
JOYSTICK_ClearButton(WII_B);
|
|
|
|
JOYSTICK_ClearButton(WII_HOME);
|
2012-06-03 16:11:22 +00:00
|
|
|
#endif
|
|
|
|
}
|
2014-06-16 23:15:49 +00:00
|
|
|
|
2019-08-07 19:12:07 +00:00
|
|
|
int32_t I_GeneralTrigger(void)
|
|
|
|
{
|
2019-08-13 09:15:49 +00:00
|
|
|
return
|
|
|
|
I_AdvanceTrigger()
|
|
|
|
|| I_ReturnTrigger()
|
|
|
|
#if !defined GEKKO
|
|
|
|
|| BUTTON(gamefunc_Open)
|
|
|
|
# if !defined EDUKE32_TOUCH_DEVICES
|
|
|
|
|| MOUSEINACTIVECONDITIONAL(BUTTON(gamefunc_Fire))
|
|
|
|
# else
|
|
|
|
|| BUTTON(gamefunc_Fire)
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
|| BUTTON(gamefunc_Crouch)
|
|
|
|
|| (JOYSTICK_GetGameControllerButtons()&(1<<GAMECONTROLLER_BUTTON_START))
|
|
|
|
;
|
2019-08-07 19:12:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void I_GeneralTriggerClear(void)
|
|
|
|
{
|
|
|
|
I_AdvanceTriggerClear();
|
|
|
|
I_ReturnTriggerClear();
|
2019-08-13 09:15:49 +00:00
|
|
|
#if !defined GEKKO
|
|
|
|
CONTROL_ClearButton(gamefunc_Open);
|
|
|
|
CONTROL_ClearButton(gamefunc_Fire);
|
|
|
|
#endif
|
|
|
|
CONTROL_ClearButton(gamefunc_Crouch);
|
|
|
|
JOYSTICK_ClearGameControllerButton(1<<GAMECONTROLLER_BUTTON_START);
|
2019-08-07 19:12:07 +00:00
|
|
|
}
|
|
|
|
|
2014-06-16 23:15:49 +00:00
|
|
|
|
|
|
|
int32_t I_EscapeTrigger(void)
|
2012-06-03 16:11:22 +00:00
|
|
|
{
|
2019-08-13 09:15:49 +00:00
|
|
|
return
|
|
|
|
KB_KeyPressed(sc_Escape)
|
|
|
|
|| (JOYSTICK_GetGameControllerButtons()&(1<<GAMECONTROLLER_BUTTON_START))
|
2012-06-03 16:11:22 +00:00
|
|
|
#if defined(GEKKO)
|
2019-08-13 09:15:49 +00:00
|
|
|
|| (JOYSTICK_GetButtons()&WII_HOME)
|
2012-06-03 16:11:22 +00:00
|
|
|
#endif
|
2019-08-13 09:15:49 +00:00
|
|
|
;
|
2012-06-03 16:11:22 +00:00
|
|
|
}
|
2014-06-16 23:15:49 +00:00
|
|
|
|
|
|
|
void I_EscapeTriggerClear(void)
|
2012-06-03 16:11:22 +00:00
|
|
|
{
|
2014-06-16 23:15:49 +00:00
|
|
|
KB_FlushKeyboardQueue();
|
|
|
|
KB_ClearKeyDown(sc_Escape);
|
2019-08-13 09:15:49 +00:00
|
|
|
JOYSTICK_ClearGameControllerButton(1<<GAMECONTROLLER_BUTTON_START);
|
2012-06-03 16:11:22 +00:00
|
|
|
#if defined(GEKKO)
|
2014-06-16 23:15:49 +00:00
|
|
|
JOYSTICK_ClearButton(WII_HOME);
|
2012-06-03 16:11:22 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2014-06-16 23:15:49 +00:00
|
|
|
|
|
|
|
int32_t I_MenuUp(void)
|
2012-06-03 16:11:22 +00:00
|
|
|
{
|
2019-08-13 09:15:49 +00:00
|
|
|
return
|
|
|
|
KB_KeyPressed(sc_UpArrow)
|
|
|
|
|| KB_KeyPressed(sc_kpad_8)
|
|
|
|
|| (MOUSE_GetButtons()&WHEELUP_MOUSE)
|
|
|
|
|| BUTTON(gamefunc_Move_Forward)
|
|
|
|
|| (JOYSTICK_GetHat(0)&HAT_UP)
|
|
|
|
|| (JOYSTICK_GetGameControllerButtons()&(1<<GAMECONTROLLER_BUTTON_DPAD_UP))
|
2019-08-13 09:15:58 +00:00
|
|
|
|| CONTROL_GetGameControllerDigitalAxisNeg(GAMECONTROLLER_AXIS_LEFTY)
|
2019-08-13 09:15:49 +00:00
|
|
|
;
|
2012-06-03 16:11:22 +00:00
|
|
|
}
|
2014-06-16 23:15:49 +00:00
|
|
|
|
|
|
|
void I_MenuUpClear(void)
|
2012-06-03 16:11:22 +00:00
|
|
|
{
|
2014-06-16 23:15:49 +00:00
|
|
|
KB_ClearKeyDown(sc_UpArrow);
|
|
|
|
KB_ClearKeyDown(sc_kpad_8);
|
|
|
|
MOUSE_ClearButton(WHEELUP_MOUSE);
|
|
|
|
CONTROL_ClearButton(gamefunc_Move_Forward);
|
|
|
|
JOYSTICK_ClearHat(0);
|
2019-08-13 09:15:49 +00:00
|
|
|
JOYSTICK_ClearGameControllerButton(1<<GAMECONTROLLER_BUTTON_DPAD_UP);
|
2019-08-13 09:15:58 +00:00
|
|
|
CONTROL_ClearGameControllerDigitalAxisNeg(GAMECONTROLLER_AXIS_LEFTY);
|
2012-06-03 16:11:22 +00:00
|
|
|
}
|
2014-06-16 23:15:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
int32_t I_MenuDown(void)
|
2012-06-03 16:11:22 +00:00
|
|
|
{
|
2019-08-13 09:15:49 +00:00
|
|
|
return
|
|
|
|
KB_KeyPressed(sc_DownArrow)
|
|
|
|
|| KB_KeyPressed(sc_kpad_2)
|
|
|
|
|| (MOUSE_GetButtons()&WHEELDOWN_MOUSE)
|
|
|
|
|| BUTTON(gamefunc_Move_Backward)
|
|
|
|
|| (JOYSTICK_GetHat(0)&HAT_DOWN)
|
|
|
|
|| (JOYSTICK_GetGameControllerButtons()&(1<<GAMECONTROLLER_BUTTON_DPAD_DOWN))
|
2019-08-13 09:15:58 +00:00
|
|
|
|| CONTROL_GetGameControllerDigitalAxisPos(GAMECONTROLLER_AXIS_LEFTY)
|
2019-08-13 09:15:49 +00:00
|
|
|
;
|
2012-06-03 16:11:22 +00:00
|
|
|
}
|
2014-06-16 23:15:49 +00:00
|
|
|
|
|
|
|
void I_MenuDownClear(void)
|
2012-06-03 16:11:22 +00:00
|
|
|
{
|
2014-06-16 23:15:49 +00:00
|
|
|
KB_ClearKeyDown(sc_DownArrow);
|
|
|
|
KB_ClearKeyDown(sc_kpad_2);
|
|
|
|
KB_ClearKeyDown(sc_PgDn);
|
|
|
|
MOUSE_ClearButton(WHEELDOWN_MOUSE);
|
|
|
|
CONTROL_ClearButton(gamefunc_Move_Backward);
|
|
|
|
JOYSTICK_ClearHat(0);
|
2019-08-13 09:15:49 +00:00
|
|
|
JOYSTICK_ClearGameControllerButton(1<<GAMECONTROLLER_BUTTON_DPAD_DOWN);
|
2019-08-13 09:15:58 +00:00
|
|
|
CONTROL_ClearGameControllerDigitalAxisPos(GAMECONTROLLER_AXIS_LEFTY);
|
2012-06-03 16:11:22 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-06-16 23:15:49 +00:00
|
|
|
int32_t I_MenuLeft(void)
|
2012-06-03 16:11:22 +00:00
|
|
|
{
|
2019-08-13 09:15:49 +00:00
|
|
|
return
|
|
|
|
KB_KeyPressed(sc_LeftArrow)
|
|
|
|
|| KB_KeyPressed(sc_kpad_4)
|
|
|
|
|| (SHIFTS_IS_PRESSED && KB_KeyPressed(sc_Tab))
|
|
|
|
|| BUTTON(gamefunc_Turn_Left)
|
|
|
|
|| BUTTON(gamefunc_Strafe_Left)
|
|
|
|
|| (JOYSTICK_GetHat(0)&HAT_LEFT)
|
|
|
|
|| (JOYSTICK_GetGameControllerButtons()&(1<<GAMECONTROLLER_BUTTON_DPAD_LEFT))
|
2019-08-13 09:15:58 +00:00
|
|
|
|| CONTROL_GetGameControllerDigitalAxisNeg(GAMECONTROLLER_AXIS_LEFTX)
|
2019-08-13 09:15:49 +00:00
|
|
|
;
|
2012-06-03 16:11:22 +00:00
|
|
|
}
|
2014-06-16 23:15:49 +00:00
|
|
|
|
|
|
|
void I_MenuLeftClear(void)
|
2012-06-03 16:11:22 +00:00
|
|
|
{
|
|
|
|
KB_ClearKeyDown(sc_LeftArrow);
|
|
|
|
KB_ClearKeyDown(sc_kpad_4);
|
2014-06-16 23:15:49 +00:00
|
|
|
KB_ClearKeyDown(sc_Tab);
|
2012-06-03 16:11:22 +00:00
|
|
|
CONTROL_ClearButton(gamefunc_Turn_Left);
|
|
|
|
CONTROL_ClearButton(gamefunc_Strafe_Left);
|
|
|
|
JOYSTICK_ClearHat(0);
|
2019-08-13 09:15:49 +00:00
|
|
|
JOYSTICK_ClearGameControllerButton(1<<GAMECONTROLLER_BUTTON_DPAD_LEFT);
|
2019-08-13 09:15:58 +00:00
|
|
|
CONTROL_ClearGameControllerDigitalAxisNeg(GAMECONTROLLER_AXIS_LEFTX);
|
2012-06-03 16:11:22 +00:00
|
|
|
}
|
|
|
|
|
2014-06-16 23:15:49 +00:00
|
|
|
|
|
|
|
int32_t I_MenuRight(void)
|
2012-06-03 16:11:22 +00:00
|
|
|
{
|
2019-08-13 09:15:49 +00:00
|
|
|
return
|
|
|
|
KB_KeyPressed(sc_RightArrow)
|
|
|
|
|| KB_KeyPressed(sc_kpad_6)
|
|
|
|
|| (!SHIFTS_IS_PRESSED && KB_KeyPressed(sc_Tab))
|
|
|
|
|| BUTTON(gamefunc_Turn_Right)
|
|
|
|
|| BUTTON(gamefunc_Strafe_Right)
|
|
|
|
|| (MOUSE_GetButtons()&MIDDLE_MOUSE)
|
|
|
|
|| (JOYSTICK_GetHat(0)&HAT_RIGHT)
|
|
|
|
|| (JOYSTICK_GetGameControllerButtons()&(1<<GAMECONTROLLER_BUTTON_DPAD_RIGHT))
|
2019-08-13 09:15:58 +00:00
|
|
|
|| CONTROL_GetGameControllerDigitalAxisPos(GAMECONTROLLER_AXIS_LEFTX)
|
2019-08-13 09:15:49 +00:00
|
|
|
;
|
2012-06-03 16:11:22 +00:00
|
|
|
}
|
2014-06-16 23:15:49 +00:00
|
|
|
|
|
|
|
void I_MenuRightClear(void)
|
2012-06-03 16:11:22 +00:00
|
|
|
{
|
|
|
|
KB_ClearKeyDown(sc_RightArrow);
|
|
|
|
KB_ClearKeyDown(sc_kpad_6);
|
2014-06-16 23:15:49 +00:00
|
|
|
KB_ClearKeyDown(sc_Tab);
|
2012-06-03 16:11:22 +00:00
|
|
|
CONTROL_ClearButton(gamefunc_Turn_Right);
|
|
|
|
CONTROL_ClearButton(gamefunc_Strafe_Right);
|
2014-06-16 23:15:49 +00:00
|
|
|
MOUSE_ClearButton(MIDDLE_MOUSE);
|
2012-06-03 16:11:22 +00:00
|
|
|
JOYSTICK_ClearHat(0);
|
2019-08-13 09:15:49 +00:00
|
|
|
JOYSTICK_ClearGameControllerButton(1<<GAMECONTROLLER_BUTTON_DPAD_RIGHT);
|
2019-08-13 09:15:58 +00:00
|
|
|
CONTROL_ClearGameControllerDigitalAxisPos(GAMECONTROLLER_AXIS_LEFTX);
|
2014-06-16 23:15:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t I_PanelUp(void)
|
|
|
|
{
|
2019-08-13 09:15:49 +00:00
|
|
|
return
|
|
|
|
I_MenuUp()
|
|
|
|
|| I_MenuLeft()
|
|
|
|
|| KB_KeyPressed(sc_PgUp)
|
|
|
|
;
|
2012-06-03 16:11:22 +00:00
|
|
|
}
|
|
|
|
|
2014-06-16 23:15:49 +00:00
|
|
|
void I_PanelUpClear(void)
|
|
|
|
{
|
|
|
|
I_MenuUpClear();
|
|
|
|
I_MenuLeftClear();
|
2019-08-13 09:15:49 +00:00
|
|
|
KB_ClearKeyDown(sc_PgUp);
|
2014-06-16 23:15:49 +00:00
|
|
|
}
|
2012-06-03 16:11:22 +00:00
|
|
|
|
|
|
|
|
2014-06-16 23:15:49 +00:00
|
|
|
int32_t I_PanelDown(void)
|
2014-05-31 12:26:41 +00:00
|
|
|
{
|
2019-08-13 09:15:49 +00:00
|
|
|
return
|
|
|
|
I_MenuDown()
|
|
|
|
|| I_MenuRight()
|
|
|
|
|| KB_KeyPressed(sc_PgDn)
|
|
|
|
|| I_AdvanceTrigger()
|
|
|
|
;
|
2014-05-31 12:26:41 +00:00
|
|
|
}
|
2014-06-16 23:15:49 +00:00
|
|
|
|
|
|
|
void I_PanelDownClear(void)
|
|
|
|
{
|
|
|
|
I_MenuDownClear();
|
|
|
|
I_MenuRightClear();
|
2019-08-13 09:15:49 +00:00
|
|
|
KB_ClearKeyDown(sc_PgDn);
|
2014-06-16 23:15:49 +00:00
|
|
|
I_AdvanceTriggerClear();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int32_t I_SliderLeft(void)
|
2014-05-31 12:26:41 +00:00
|
|
|
{
|
2019-08-13 09:15:49 +00:00
|
|
|
return
|
|
|
|
I_MenuLeft()
|
2014-12-27 18:36:58 +00:00
|
|
|
#if !defined EDUKE32_TOUCH_DEVICES
|
2019-08-13 09:15:49 +00:00
|
|
|
|| MOUSEINACTIVECONDITIONAL((MOUSE_GetButtons()&LEFT_MOUSE) && (MOUSE_GetButtons()&WHEELUP_MOUSE))
|
2014-12-27 18:36:58 +00:00
|
|
|
#endif
|
2019-08-13 09:15:49 +00:00
|
|
|
;
|
2014-05-31 12:26:41 +00:00
|
|
|
}
|
2012-06-03 16:11:22 +00:00
|
|
|
|
2014-06-16 23:15:49 +00:00
|
|
|
void I_SliderLeftClear(void)
|
|
|
|
{
|
|
|
|
I_MenuLeftClear();
|
|
|
|
MOUSE_ClearButton(WHEELUP_MOUSE);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2014-05-31 12:26:41 +00:00
|
|
|
int32_t I_SliderRight(void)
|
|
|
|
{
|
2019-08-13 09:15:49 +00:00
|
|
|
return
|
|
|
|
I_MenuRight()
|
2014-12-27 18:36:58 +00:00
|
|
|
#if !defined EDUKE32_TOUCH_DEVICES
|
2019-08-13 09:15:49 +00:00
|
|
|
|| MOUSEINACTIVECONDITIONAL((MOUSE_GetButtons()&LEFT_MOUSE) && (MOUSE_GetButtons()&WHEELDOWN_MOUSE))
|
2014-12-27 18:36:58 +00:00
|
|
|
#endif
|
2019-08-13 09:15:49 +00:00
|
|
|
;
|
2014-05-31 12:26:41 +00:00
|
|
|
}
|
2014-06-16 23:15:49 +00:00
|
|
|
|
|
|
|
void I_SliderRightClear(void)
|
2014-05-31 12:26:41 +00:00
|
|
|
{
|
2014-06-16 23:15:49 +00:00
|
|
|
I_MenuRightClear();
|
|
|
|
MOUSE_ClearButton(WHEELDOWN_MOUSE);
|
2014-05-31 12:26:41 +00:00
|
|
|
}
|
2012-06-03 16:11:22 +00:00
|
|
|
|
2014-06-16 23:15:49 +00:00
|
|
|
|
2014-05-31 12:26:41 +00:00
|
|
|
int32_t I_EnterText(char *t, int32_t maxlength, int32_t flags)
|
2012-06-03 16:11:22 +00:00
|
|
|
{
|
|
|
|
char ch;
|
2014-05-31 12:26:41 +00:00
|
|
|
int32_t inputloc = Bstrlen(typebuf);
|
2012-06-03 16:11:22 +00:00
|
|
|
|
2012-11-17 16:48:11 +00:00
|
|
|
while ((ch = KB_GetCh()) != 0)
|
2012-06-03 16:11:22 +00:00
|
|
|
{
|
|
|
|
if (ch == asc_BackSpace)
|
|
|
|
{
|
|
|
|
if (inputloc > 0)
|
|
|
|
{
|
|
|
|
inputloc--;
|
|
|
|
*(t+inputloc) = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (ch == asc_Enter)
|
|
|
|
{
|
|
|
|
I_AdvanceTriggerClear();
|
2014-05-31 12:26:41 +00:00
|
|
|
return 1;
|
2012-06-03 16:11:22 +00:00
|
|
|
}
|
|
|
|
else if (ch == asc_Escape)
|
|
|
|
{
|
|
|
|
I_ReturnTriggerClear();
|
2014-05-31 12:26:41 +00:00
|
|
|
return -1;
|
2012-06-03 16:11:22 +00:00
|
|
|
}
|
2014-05-31 12:26:41 +00:00
|
|
|
else if (ch >= 32 && inputloc < maxlength && ch < 127)
|
2012-06-03 16:11:22 +00:00
|
|
|
{
|
2014-05-31 12:26:41 +00:00
|
|
|
if (!(flags & INPUT_NUMERIC) || (ch >= '0' && ch <= '9'))
|
2012-06-03 16:11:22 +00:00
|
|
|
{
|
|
|
|
// JBF 20040508: so we can have numeric only if we want
|
|
|
|
*(t+inputloc) = ch;
|
|
|
|
*(t+inputloc+1) = 0;
|
|
|
|
inputloc++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-08-16 00:20:52 +00:00
|
|
|
if (I_TextSubmit())
|
2019-08-14 03:04:04 +00:00
|
|
|
{
|
2019-08-16 00:20:52 +00:00
|
|
|
I_TextSubmitClear();
|
2019-08-14 03:04:04 +00:00
|
|
|
return 1;
|
|
|
|
}
|
2014-05-31 12:26:41 +00:00
|
|
|
if (I_ReturnTrigger())
|
2012-06-03 16:11:22 +00:00
|
|
|
{
|
2014-05-31 12:26:41 +00:00
|
|
|
I_ReturnTriggerClear();
|
|
|
|
return -1;
|
2012-06-03 16:11:22 +00:00
|
|
|
}
|
|
|
|
|
2014-05-31 12:26:41 +00:00
|
|
|
return 0;
|
2012-06-03 16:11:22 +00:00
|
|
|
}
|