func_maxgui_setgadgetsensitivity.rst 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. .. _func_maxgui_setgadgetsensitivity:
  2. ====================
  3. SetGadgetSensitivity
  4. ====================
  5. SetGadgetSensitivity -
  6. Description
  7. ===========
  8. .. code-block:: blitzmax
  9. SetGadgetSensitivity( gadget:TGadget, flags )
  10. Sets whether a standard MaxGUI gadget emits events from the keyboard or mouse.
  11. This functions attempts to provide similar functionality for all gadgets to that of @Panels created with the PANEL_ACTIVE flag.
  12. The @flags parameter can be any combination of the following:
  13. SENSITIZE_MOUSE: The gadget will emit the following events:
  14. [ @{Event ID} | @Description
  15. * EVENT_MOUSEDOWN | Mouse button pressed. Event data contains mouse button code.
  16. * EVENT_MOUSEUP | Mouse button released. Event data contains mouse button code.
  17. * EVENT_MOUSEMOVE | Mouse moved. Event x and y contain mouse coordinates.
  18. * EVENT_MOUSEWHEEL | Mouse wheel spun. Event data contains delta clicks.
  19. * EVENT_MOUSEENTER | Mouse entered gadget area.
  20. * EVENT_MOUSELEAVE | Mouse left gadget area.
  21. ]
  22. SENSITIZE_KEYS: The gadget will emit the following events:
  23. [ @{Event ID} | @Description
  24. * EVENT_KEYDOWN | Key pressed. Event data contains keycode.
  25. * EVENT_KEYUP | Key released. Event data contains keycode.
  26. * EVENT_KEYREPEAT | Key is being held down. Event data contains keycode.
  27. ]
  28. SENSITIZE_ALL: Exactly the same as combining SENSITIZE_MOUSE and SENSITIZE_KEYS.
  29. Gadgets that have been disabled should not emit key events, although they may still emit mouse events.
  30. Not all gadgets will be able to emit all of the events, particularly those that don't receive typical focus
  31. such as labels or htmlviews, but even this may differ depending on the platform.
  32. %{@Warning: This is a powerful new function that possibly involves hooking into the system's message queue
  33. to ask for mouse/key events before they are processed even by the OS's GUI library. As such, using this function
  34. on certain controls may cause them to be behave differently. In addition, care should be taken when using
  35. this function to avoid infinite loops, for example repositioning gadgets in an event hook that processes the
  36. message as it is received.
  37. As a result, it is to be recommended that this function is only used by advanced MaxGUI users.
  38. See Also: #GadgetSensitivity
  39. Parameters
  40. ==========
  41. Return Values
  42. =============
  43. Nothing.
  44. Examples
  45. ========
  46. See Also
  47. ========