mirror of
https://github.com/YGGverse/xash3d-fwgs.git
synced 2025-01-17 18:40:02 +00:00
engine: client: add barebones gamepad controls to input fields
This commit is contained in:
parent
15ba932046
commit
d944301a60
@ -1230,7 +1230,7 @@ void Field_KeyDownEvent( field_t *edit, int key )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( key == K_BACKSPACE )
|
if( key == K_BACKSPACE || key == K_B_BUTTON )
|
||||||
{
|
{
|
||||||
if( edit->cursor > 0 )
|
if( edit->cursor > 0 )
|
||||||
{
|
{
|
||||||
@ -1242,7 +1242,7 @@ void Field_KeyDownEvent( field_t *edit, int key )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( key == K_RIGHTARROW )
|
if( key == K_RIGHTARROW || key == K_DPAD_RIGHT )
|
||||||
{
|
{
|
||||||
if( edit->cursor < len ) edit->cursor = Con_UtfMoveRight( edit->buffer, edit->cursor, edit->widthInChars );
|
if( edit->cursor < len ) edit->cursor = Con_UtfMoveRight( edit->buffer, edit->cursor, edit->widthInChars );
|
||||||
if( edit->cursor >= edit->scroll + edit->widthInChars && edit->cursor <= len )
|
if( edit->cursor >= edit->scroll + edit->widthInChars && edit->cursor <= len )
|
||||||
@ -1250,7 +1250,7 @@ void Field_KeyDownEvent( field_t *edit, int key )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( key == K_LEFTARROW )
|
if( key == K_LEFTARROW || key == K_DPAD_LEFT )
|
||||||
{
|
{
|
||||||
if( edit->cursor > 0 ) edit->cursor = Con_UtfMoveLeft( edit->buffer, edit->cursor );
|
if( edit->cursor > 0 ) edit->cursor = Con_UtfMoveLeft( edit->buffer, edit->cursor );
|
||||||
if( edit->cursor < edit->scroll ) edit->scroll--;
|
if( edit->cursor < edit->scroll ) edit->scroll--;
|
||||||
@ -1547,8 +1547,8 @@ void Key_Console( int key )
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// enter finishes the line
|
// enter or A finish the line
|
||||||
if( key == K_ENTER || key == K_KP_ENTER )
|
if( key == K_ENTER || key == K_KP_ENTER || key == K_A_BUTTON )
|
||||||
{
|
{
|
||||||
// backslash text are commands, else chat
|
// backslash text are commands, else chat
|
||||||
if( con.input.buffer[0] == '\\' || con.input.buffer[0] == '/' )
|
if( con.input.buffer[0] == '\\' || con.input.buffer[0] == '/' )
|
||||||
@ -1575,7 +1575,7 @@ void Key_Console( int key )
|
|||||||
}
|
}
|
||||||
|
|
||||||
// command completion
|
// command completion
|
||||||
if( key == K_TAB )
|
if( key == K_TAB || key == K_X_BUTTON )
|
||||||
{
|
{
|
||||||
Con_CompleteCommand( &con.input );
|
Con_CompleteCommand( &con.input );
|
||||||
Con_Bottom();
|
Con_Bottom();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user