interprets input on this gadget. this gadget is in focus.
| 205 | |
| 206 | // interprets input on this gadget. this gadget is in focus. |
| 207 | void UIGadget::Process(bool do_keys, bool do_mouse, bool do_user) { |
| 208 | // do mouse processing on this gadget if and only if no slave processing was done. |
| 209 | if (UI_input.b1_status == UIMSEBTN_PRESSED && do_mouse) { |
| 210 | OnMouseBtnDown(UILMSEBTN); |
| 211 | UI_input.b1_last_status = UIMSEBTN_PRESSED; // DAJ use to latch the UI mouse button |
| 212 | } else if (UI_input.b1_status == UIMSEBTN_RELEASED && do_mouse) { |
| 213 | OnMouseBtnUp(UILMSEBTN); |
| 214 | UI_input.b1_last_status = UIMSEBTN_RELEASED; // DAJ use to latch the UI mouse button |
| 215 | } else if (UI_input.b1_status == UIMSEBTN_CLICKED && do_mouse) { |
| 216 | OnMouseBtnDown(UILMSEBTN); |
| 217 | OnMouseBtnUp(UILMSEBTN); |
| 218 | } else if (do_keys) { |
| 219 | // keyboard processing. |
| 220 | switch (UI_input.key) { |
| 221 | case KEY_ENTER: |
| 222 | if ((UI_input.key_status == UIKEY_PRESSED) || (UI_input.key_status == UIKEY_CLICKED)) { |
| 223 | OnSelect(); |
| 224 | } |
| 225 | break; |
| 226 | } |
| 227 | |
| 228 | if (UI_input.key_status == UIKEY_PRESSED) { |
| 229 | if (TrapKey(UI_input.key)) |
| 230 | OnKeyDown(UI_input.key); |
| 231 | } else if (UI_input.key_status == UIKEY_RELEASED) { |
| 232 | UntrapKey(UI_input.key); |
| 233 | OnKeyUp(UI_input.key); |
| 234 | } else if (UI_input.key_status == UIKEY_CLICKED) { |
| 235 | if (TrapKey(UI_input.key)) |
| 236 | OnKeyDown(UI_input.key); |
| 237 | UntrapKey(UI_input.key); |
| 238 | OnKeyUp(UI_input.key); |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | // run gadget's user process |
| 243 | if (do_user) { |
| 244 | OnUserProcess(); |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | // when gadget is selected, this function will AT LEAST be called. |
| 249 | // typically this function is called by a child class when we want |
no outgoing calls
no test coverage detected