Skip to content

Commit

Permalink
END key jumps between start and end of current input string
Browse files Browse the repository at this point in the history
  • Loading branch information
BjossiAlfreds committed Oct 18, 2024
1 parent c49a703 commit 993365c
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/client/menu/qmenu.c
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ Field_Key(menufield_s *f, int key)
}
break;

case K_KP_RIGHTARROW:
case K_RIGHTARROW:
if (f->buffer[f->cursor] != '\0')
{
Expand All @@ -306,6 +307,17 @@ Field_Key(menufield_s *f, int key)
}
break;

case K_END:
if (f->buffer[f->cursor] == '\0')
{
f->cursor = 0;
}
else
{
f->cursor = strlen(f->buffer);
}
break;

case K_KP_DEL:
case K_DEL:
if (f->buffer[f->cursor] != '\0')
Expand Down

0 comments on commit 993365c

Please sign in to comment.