MCPcopy Create free account
hub / github.com/DFHack/dfhack / feed

Method feed

plugins/listcolumn.h:377–443  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375 }
376
377 bool feed(set<df::interface_key> *input)
378 {
379 feed_mouse_set_highlight = feed_changed_highlight = false;
380 if (input->count(interface_key::STANDARDSCROLL_UP))
381 {
382 changeHighlight(-1);
383 }
384 else if (input->count(interface_key::STANDARDSCROLL_DOWN))
385 {
386 changeHighlight(1);
387 }
388 else if (input->count(interface_key::STANDARDSCROLL_PAGEUP))
389 {
390 changeHighlight(0, -1);
391 }
392 else if (input->count(interface_key::STANDARDSCROLL_PAGEDOWN))
393 {
394 changeHighlight(0, 1);
395 }
396 else if (input->count(interface_key::SELECT) && !auto_select)
397 {
398 toggleHighlighted();
399 }
400 else if (input->count(interface_key::CUSTOM_SHIFT_S))
401 {
402 clearSearch();
403 }
404 else if (enabler->tracking_on && gps->mouse_x != -1 && gps->mouse_y != -1 && enabler->mouse_lbut)
405 {
406 return setHighlightByMouse();
407 }
408 else if (allow_search)
409 {
410 // Search query typing mode always on
411 df::interface_key last_token = get_string_key(input);
412 int charcode = Screen::keyToChar(last_token);
413 if (charcode >= 0 && validSearchInput((unsigned char)charcode))
414 {
415 // Standard character
416 search_string += char(charcode);
417 filterDisplay();
418 centerSelection();
419 }
420 else if (last_token == interface_key::STRING_A000)
421 {
422 // Backspace
423 if (search_string.length() > 0)
424 {
425 search_string.erase(search_string.length()-1);
426 filterDisplay();
427 centerSelection();
428 }
429 }
430 else
431 {
432 return false;
433 }
434

Callers

nothing calls this directly

Calls 4

get_string_keyFunction · 0.85
lengthMethod · 0.80
countMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected