This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Shazz's profile picture

[1.51+]Mouse Position

Started by Shazz, 17 March 2013 - 05:53 PM
Shazz #1
Posted 17 March 2013 - 06:53 PM
I searched but couldn't find anything except this http://www.computercraft.info/forums2/index.php?/topic/2090-14-mouse-api-and-text-highlighting/page__fromsearch__1 which is a suggestion made before mouse support was added. Plus there was no real conclusion whether this suggestion was accepted or not.

My suggestion is that there should be a new function added to the term API. This function would be: term.getMousePos() which will return x, y respective to where the mouse currently is. This will be useful for GUIs. One use that I can think of right now is to change the text/background colour of a button to show that it is clickable.
OmegaVest #2
Posted 17 March 2013 - 07:03 PM
The problem is the same with key_up and key_down; If two people are looking at the screen, how do you determine which one to focus on? Also, apparently there is no easy way to get the mouse position from the client. I know I saw Cloudy talking about this somewhere, I'll have to look for it again.

EDIT: Ah, here's one.
Shazz #3
Posted 17 March 2013 - 07:16 PM
Hadn't considered that. Maybe it should focus on whoever clicked first or whoever sent the first event.
SuicidalSTDz #4
Posted 17 March 2013 - 07:27 PM
This was already suggested and denied for reasons OmegaVest had just covered

One use that I can think of right now is to change the text/background colour of a button to show that it is clickable.
This is already possible
Cloudy #5
Posted 18 March 2013 - 01:51 AM
I've denied this so many times it isn't even funny.