================= Item_Text_HandleKey ================= */
| 10822 | ================= |
| 10823 | */ |
| 10824 | qboolean 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 | /* |
no test coverage detected