Functions/events to make more responsive UIs
znepb opened this issue ยท 4 comments
Functions and events
mouse_move (mouse_hover)
Basically, detects when the mouse is moved between CC pixels. Of course this would only work on advanced computers. What it returns would probably be similar to mouse_click. If the mouse were to move outside of the screen area, the event wouldn't be called until it goes inside the screen area again.
term.getMousePosition()
This function would return the current mouse position on the screen. If it isn't within the screen's area, it would return nil.
Why this would be useful
Currently, UIs are quite boring in CC. Adding these functions and events would give developers the opportunity to make better looking UIs.
Having sat on this for a couple of months, I'm still not happy with this and so am going to close for now. It rather irks me - I can't place why I don't like the idea of it, it just feels not CC enough, and I really don't want to do something I'll later end up regretting.
This has come up quite a few times in the past - here's some of the common counterarguments for consideration.
- CC is not exactly fast, especially on larger servers - adding more events that are updated so frequently would just add to this
- How would it work with multiple players accessing a computer in multiplayer?
- How would CC programs detect the mouse exiting the screen or the interface being closed?