[Home] [Downloads] [Search] [Help/forum]

Gammon Software Solutions forum

See www.mushclient.com/spam for dealing with forum spam. Please read the MUSHclient FAQ!

[Folder]  Entire forum
-> [Folder]  MUSHclient
. -> [Folder]  Suggestions
. . -> [Subject]  hotspot feature request

Home  |  Users  |  Search  |  FAQ
Username:
Register forum user name
Password:
Forgotten password?
(New message)
Subject: hotspot feature request
Name:
Your forum user name.
Register forum user name
Password:
Your forum password.
Forgotten password?
Message:
Message to be posted (in English, please).
Forum codes:
Check this if your message uses 'forum codes' or templates (auto-detected for new posts).
Forum codes Templates

Save this message ...


Subject review (reverse sequence)

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Tue 13 Jul 2010 04:40 AM (UTC)  quote  ]

Amended on Tue 13 Jul 2010 04:41 AM (UTC) by Nick Gammon

Message
Good point. Fixed in the documentation for the next release (and in the on-site documentation you quoted, right now).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Bast   (76 posts)  [Biography] bio
Date Tue 13 Jul 2010 03:45 AM (UTC)  quote  ]
Message
Hey Nick,

The lua example for the help at http://www.gammon.com.au/scripts/function.php?name=WindowScrollwheelHandler needs a ~= 0 on the bit.band test or you get down all the time.


function wheel_move (flags, hotspot_id)
  if bit.band (flags, 0x100) ~= 0 then

    -- wheel scrolled down (towards you)
  else

    -- wheel scrolled up (away from you)
  end -- if

  return 0  -- needed for some languages
end -- drag_move

Bast

Bast

Scripts: http://bastmush.googlecode.com
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Wed 23 Jun 2010 10:06 PM (UTC)  quote  ]
Message
Awesome! Thanks, Nick.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Wed 23 Jun 2010 09:38 PM (UTC)  quote  ]
Message
I've changed the way it works a bit. I can see the sense of wanting to alt-scroll. A little warning though, in some environments (eg, the Mac) control-scroll wheel zooms the whole window in, and the event doesn't reach the virtual machine.

Instead of the first argument to the callback being -1 or +1, now it is a bit mask like the drag callback.

The mask is:

0x01 - shift
0x02 - control
0x04 - alt
0x100 - scrolled down


So it bit 0x100 is on, the wheel was scrolled down, otherwise it was scrolled up.

Also added GetInfo (294) to let you check at any time the status of the various keys like caps lock, shift, control and so on.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Wed 23 Jun 2010 07:17 AM (UTC)  quote  ]
Message
Well, you can ctrl-click and such. They're modifier keys, after all. It's not a big issue, but I can easily see using modifiers with the scrollwheel to change what exactly you're scrolling.

Hmm, well I guess there's no way to get the modifier keys from a scrollwheel callback anyways, is there? Oh well.

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Wed 23 Jun 2010 07:08 AM (UTC)  quote  ]
Message
Twisol said:

EDIT: Nick, just curious, but is there any reason we can hold Alt and scroll to call the callback, but not Shift or Ctrl?


Why would you hold them? To give your fingers more wear and tear?

Anyway, I think that Ctrl+wheel means something like "zoom in" and that is discarded in the wheel processing.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Twisol   USA  (2,229 posts)  [Biography] bio
Date Wed 23 Jun 2010 06:27 AM (UTC)  quote  ]

Amended on Wed 23 Jun 2010 06:28 AM (UTC) by Twisol

Message
Here's a test script I used on my custom build.

function OnScroll(...)
  tprint{...}
end

WindowCreate("foo", 0, 0, 50, 50, 12, 0, 0xFFFFFF)
WindowShow("foo")

WindowAddHotspot("foo", "foo-h1", 0, 0, 49, 49, "", "", "", "", "", "", 0, 0);

WindowScrollwheelHandler("foo", "foo-h1", "OnScroll")


When the scrollwheel is moved a notch upwards, OnScroll is called with a parameter list (1, "foo-h1"). When it's moved a notch downwards, it's called with a parameter list (-1, "foo-h1"). So your OnScroll callback would probably look like:

function OnScroll(direction, hotspod_id)
  -- ...
end




EDIT: Nick, just curious, but is there any reason we can hold Alt and scroll to call the callback, but not Shift or Ctrl?

'Soludra' on Achaea

Blog: http://jonathan.com/
GitHub: http://github.com/Twisol
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Wed 23 Jun 2010 05:20 AM (UTC)  quote  ]
Message
It's a bit subtle but it is in these lines:


if (Mouse_Wheel_MiniWindow (pDoc, point, zDelta < 0 ? -1 : 1))
   return 1;


Basically you will get -1 or 1 to indicate the direction it was scrolled. This will be in the documentation for WindowScrollwheelHandler.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Bast   (76 posts)  [Biography] bio
Date Wed 23 Jun 2010 05:04 AM (UTC)  quote  ]
Message
Hey Nick,

Just curious about this. I haven't looked at the MUSHclient source any, but I was looking at the commit for this to see if there was a way to tell if the mousescroll was up or down, but couldn't figure it out. Will we be able to tell?

Bast

Bast

Scripts: http://bastmush.googlecode.com
[Go to top] top

Posted by Nick Gammon   Australia  (18,770 posts)  [Biography] bio   Forum Administrator
Date Wed 16 Jun 2010 03:56 AM (UTC)  quote  ]
Message
Added to version 4.52 (WindowScrollwheelHandler function).

- Nick Gammon

www.gammon.com.au, www.mushclient.com
[Go to top] top

Posted by Bast   (76 posts)  [Biography] bio
Date Tue 15 Jun 2010 07:14 PM (UTC)  quote  ]
Message
Allow mouse scroll wheel events to be used in hotspots, so that you can use the scrollup/scrolldown to navigate a miniwindow.

Thanks,
Bast

Bast

Scripts: http://bastmush.googlecode.com
[Go to top] 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.


2,198 views.

[Reply to this subject]  Reply to this subject   [New subject]  Start a new subject   [Refresh] Refresh page

Go to topic:           Search the forum


[Go to top] top

[Home]

Written by Nick Gammon - 5K

Comments to: Gammon Software support
[RH click to get RSS URL] Forum RSS feed ( http://www.gammon.com.au/rss/forum.xml )

[Best viewed with any browser - 2K]    [Internet Contents Rating Association (ICRA) - 2K]    [Web site powered by FutureQuest.Net]