MCPcopy Create free account
hub / github.com/JACoders/OpenJK / Item_Text_HandleKey

Function Item_Text_HandleKey

code/ui/ui_shared.cpp:10824–10853  ·  view source on GitHub ↗

================= Item_Text_HandleKey ================= */

Source from the content-addressed store, hash-verified

10822=================
10823*/
10824qboolean Item_Text_HandleKey(itemDef_t *item, int key)
10825{
10826 if (Rect_ContainsPoint(&item->window.rect, DC->cursorx, DC->cursory) && item->window.flags & WINDOW_AUTOWRAPPED)
10827
10828
10829 {
10830 if (key == A_MOUSE1 || key == A_ENTER || key == A_MOUSE2 || key == A_MOUSE3)
10831 {
10832 if (key == A_MOUSE2)
10833 {
10834 item->cursorPos--;
10835 if ( item->cursorPos < 0 )
10836 {
10837 item->cursorPos = 0;
10838 }
10839 }
10840 else if (item->special)
10841 {
10842 item->cursorPos++;
10843 if ( item->cursorPos >= item->value )
10844 {
10845 item->cursorPos = 0;
10846 }
10847 }
10848 return qtrue;
10849 }
10850 }
10851
10852 return qfalse;
10853}
10854
10855
10856/*

Callers 1

Item_HandleKeyFunction · 0.85

Calls 1

Rect_ContainsPointFunction · 0.70

Tested by

no test coverage detected