Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: "RightDoubleClick" without "RightClick"?  (Read 5124 times)

0 Members and 1 Guest are viewing this topic.

DocBass

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 136
    • View Profile
"RightDoubleClick" without "RightClick"?
« on: July 19, 2008, 10:04:19 AM »

I am trying to assign two different functions to RightClick and RightDoubleClick. RightClick is to bring up the interaction menu when hovering over an item as can be expected. RightDoubleClick is meant to be a different function entirely, but equally as important. The problem is if I try and RightDoubleClick over an interactive object, it simply brings up the menu. It will work when the menu is already up and I RightDoubleClick again, but I am trying to avoid this kinda of inconsistency.

Is there a way to check for a RightDoubleClick, or perhaps wait for one, before passing through a RightClick event? Or do I just need to think of a different way?  :)
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: "RightDoubleClick" without "RightClick"?
« Reply #1 on: July 19, 2008, 11:03:01 AM »

Unfortunately, that's how it works. In case of double click, you'll receive normal click and release events first. I believe meta's been solving a similar problem, perhaps he'll share his experience.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

metamorphium

  • Global Moderator
  • Addicted to WME forum
  • *
  • Karma: 12
  • Offline Offline
  • Gender: Male
  • Posts: 1511
  • Vampires!
    • View Profile
    • CBE  software s.r.o.
Re: "RightDoubleClick" without "RightClick"?
« Reply #2 on: July 19, 2008, 12:56:25 PM »

I've solved it some time ago already. My solution was based on a little timer in RightClick event.

In case your timer was 300ms, the solution would have been:


on "RightClick"
{
   Sleep(300);
   if (Game.DoubleClicked) return;

  //  go on with your function
}

on "RightDoubleClick"
{
   Game.DoubleClicked = true;
}

This is simplified version of course. You'd need at the end of your RightDoubleClick reset again the variable so the doubleclick is "forgotten" for the next instance.

I hope this helps...
Logged
J.U.L.I.A. Enhanced Edition, Vampires!, J.U.L.I.A., J.U.L.I.A. Untold, Ghost in the Sheet

DocBass

  • Regular poster
  • ***
  • Karma: 0
  • Offline Offline
  • Posts: 136
    • View Profile
Re: "RightDoubleClick" without "RightClick"?
« Reply #3 on: July 19, 2008, 09:00:12 PM »

I've solved it some time ago already. My solution was based on a little timer in RightClick event.

In case your timer was 300ms, the solution would have been:


on "RightClick"
{
   Sleep(300);
   if (Game.DoubleClicked) return;

  //  go on with your function
}

on "RightDoubleClick"
{
   Game.DoubleClicked = true;
}

This is simplified version of course. You'd need at the end of your RightDoubleClick reset again the variable so the doubleclick is "forgotten" for the next instance.

I hope this helps...

So simple, yet clever. Thanks guys, I appreciate it as usual!!
Logged
 

Page created in 0.042 seconds with 24 queries.