Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to "verify" your details, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
➜ MUSHclient
➜ General
➜ Mouse position
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Darwin
USA (125 posts) Bio
|
Date
| Fri 08 Aug 2008 08:28 AM (UTC) |
Message
| Is there a callback function to track the position of the mouse? If there was, clicking and dragging windows would be possible. | Top |
|
Posted by
| Nick Gammon
Australia (23,068 posts) Bio
Forum Administrator |
Date
| Reply #1 on Fri 08 Aug 2008 09:50 PM (UTC) |
Message
| No not at present. Dragging windows is more complex than knowing where the mouse is, otherwise I would have implemented that in the existing version.
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Yergo
Poland (20 posts) Bio
|
Date
| Reply #2 on Fri 29 Aug 2008 08:37 PM (UTC) Amended on Fri 29 Aug 2008 08:40 PM (UTC) by Yergo
|
Message
| It'll be useful when scripting miniwindows moving :> Just calculate mouse position difference between MouseDown and CancelMouseDown actions on hotspot, apply them, redraw window and done. Moving, resizing, even scrolling. Only this one thing is missing to make these things possible to code them clearly.
imo, it should be added. By the way I'm waiting only for this, to start code my own chatminiwindow plugin, then graphic scrollable/movable/clickable mapper. Summertime is ending, I wish it was added so far :\
PS: Nick, I know I'm grumbling all the time... I'd like you to know, that you make a really good stuff and I'm very impressed of your job. Big thanks and keep goin'! :) |
I'm doing my best with English... Sorry ;)
Scripting: php (currently rewriting things to Lua) | Top |
|
Posted by
| Nick Gammon
Australia (23,068 posts) Bio
Forum Administrator |
Date
| Reply #3 on Sat 30 Aug 2008 01:42 AM (UTC) |
Message
| You will be pleased to hear that some sort of positive support for mouse dragging will be the next thing I will look at, now that version 4.36 is released.
I think it needs more than merely knowing the x,y position through GetInfo. A more useful thing would be an optional script that is called either during mouse movement, or upon mouse release.
For example, a scrollbar, which I am trying to do right now, really needs to know movement when it happens, whereas drag-and-drop is more interested in knowing where the drop occurs.
Just thinking aloud here a bit, but I think we probably need:
- Script function to be called when the mouse moves (eg. to move a scrollbar thumb).
- Script function to be called when the mouse is released (eg. to reposition a window)
- Optional drag rectangle to be drawn during dragging (like when you drag windows around)
- Optional drag icon (eg. for dragging an item from inventory to equipment) which might show a sword being dragged
- Optional mouse pointer update during dragging (eg. to change between "OK to drop" and "don't drop here" icons)
- Optional designation of hotspots as drop targets - eg. if I can drag an inventory item to an equipped items window, the target window needs notification that the drop occurred.
Let me know if you think I have omitted anything important.
Also I think an ability to have a pop-up menu at the mouse position, eg. if you click on an inventory item a menu might pop up "use/equip/drop/sell".
|
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Yergo
Poland (20 posts) Bio
|
Date
| Reply #4 on Sat 30 Aug 2008 09:21 AM (UTC) Amended on Sat 30 Aug 2008 09:28 AM (UTC) by Yergo
|
Message
| The popup menu should be encodeable with miniwindows nicely, when mouse position will be added. But, if you're planning to make this stuff so good as written above, I think there're missing separate actions for rightclick/middleclick/middlescroll only (or separate var passed to called back functions).
One other suggestion I realised when writing last sentence: there should be an ability to send hotspot_id and some second optional var (eg. to pass which mouse button is pressed or other useful modificators) to callback function - to allow coders writing one function for multiple actions.
Anyway, if all above encoded - all these things with drops etc - it will be a first step to make mudlient looking best ever even dreamt. My God, game gui'ed almost as Tibia :D |
I'm doing my best with English... Sorry ;)
Scripting: php (currently rewriting things to Lua) | Top |
|
Posted by
| Nick Gammon
Australia (23,068 posts) Bio
Forum Administrator |
Date
| Reply #5 on Sat 30 Aug 2008 09:02 PM (UTC) |
Message
| Don't worry about the hotspot id, that would naturally be supplied to any callback functions, as well as provision for different mouse clicks. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
17,961 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top