Jump to content


Photo

Real-Time Mouse Gestures V' 2.1


  • Please log in to reply
12 replies to this topic

#1 Danny Joseph

Danny Joseph

    GMC Member

  • New Member
  • 82 posts

Posted 03 May 2011 - 07:31 AM

( orginally posted under `open source`, but i felt here was more applicable )

Posted Image

Posted Image

real-time mouse gesture recognition


Hey Forum :)

Over a year ago I developed a theoretic program for gesture recognition for game maker. However my programming wasn't really up for the task back then, so unfortunately it was left to rust. However I decided to dig out the old theory, give it a shot and found that within 30 minutes, I had a working gesture recognition program.

I then proceeded to make it extra user friendly and even allow the gestures to become real-time ( which was the hard part, but means the user does not need to hold down any button to signal he/she is `gesturing` ). After lots of final touches, we have what is known today as GM-RMG ^_^


What are Mouse Gestures?
Think as Mouse gestures as sign language, you move your arms in a certain manner, and the other person understands. Like-wise, using Mouse Gestures you are able to communicate with the computer ( tell it what to do ) using the movement of your cursor :)

Using GM-RMG
Use of GM-RMG is extremly easy, infact there are only 3 functions, and 99% of the time you'll only use two of them :)


{   gestures_enable(  enable,  trigger  ) ;
    // `Trigger` is the mouse/keyboard button which the user should hold down to signal they are `gesturing`
    // use mb_none for `real-time` ( see 1st paragraph for what `real-time` means )
    
    
    if gestures_get_enabled()  =  true
        {  /* Return if Gestures are enabled */  }
    
    if gestures_check(  'left',  'right',  'left',  'right'  )  =  true
        {  /* return if cursor has moved `left right, left right.
              You can enter up to 16 arguments :) */  }
    
    //which could also be written as:  ( Note, always use 360, not 0 )  :)
    if gestures_check(  180, 360,  180, 360  )  =  true
        {  /* do this */  }
    
    // There you have it :)
}

Download ( Version 2.1 )

I have put allot of hard work into this so credit is also appreciated if used, thank you ^_^



Edited by Danny Joseph, 03 May 2011 - 10:43 AM.

  • 1

#2 Danny Joseph

Danny Joseph

    GMC Member

  • New Member
  • 82 posts

Posted 03 May 2011 - 07:33 AM

Updates

  • Added error checking to show a message if a function isn't entered correctly.
  • Uploaded the TechDemo GMK file
  • Tech Demo Graphic Update and all un-MouseGesture-related code made hidden ( placed under room's `creation code` )
  • Optimization added, If the largest `gesture` you have is 4 directions ( eg: left, right, left, right ) then gm-rmg will now only remember the last 4 directions that the cursor has travelled in, instead of 16. )
  • GameMaker 8.1 allows further code optimization, so gm-rmg now detects if you are using GameMaker 8.1, and if you are, uses these optimizations
  • Updated the directions variables so their Game Maker's defaults. ( 360, 90, 180 and 270 )
  • All files are now compressed into one Zip
  • HTML Help file added to download pack

Edited by Danny Joseph, 03 May 2011 - 09:45 AM.

  • 0

#3 piluke

piluke

    Pixel Matrix Member

  • GMC Member
  • 490 posts
  • Version:GM8

Posted 03 May 2011 - 10:33 AM

I can't seem to be able to download this, and I don't think it's my connection because Mediafire has been really slow lately. It gets about halfway, then slows to a crawl. I guess I'll later.

EDIT:
Thanks Danny, but I actually just finished downloading it.

Good job on this, it works well while still being user friendly. I'd like to be able to go to all directions not just 90, 180, 270, and 360, but it's good enough for me.

I don't see myself using this soon, but I'm sure others could.

-Luke

Edited by piluke, 03 May 2011 - 10:54 AM.

  • 0

#4 Danny Joseph

Danny Joseph

    GMC Member

  • New Member
  • 82 posts

Posted 03 May 2011 - 10:59 AM

Good job on this, it works well while still being user friendly. I'd like to be able to go to all directions not just 90, 180, 270, and 360, but it's good enough for me.

I'm currently playing with a theory which would allow exact shapes to be recognized ( aka the user could move their cursor in the shape of the letter 'G' ) - so far it's mental calculations, taking what I've learn't from developing 2.1 and working out a program structure.

Edited by Danny Joseph, 03 May 2011 - 11:49 AM.

  • 0

#5 T194

T194

    GMC Member

  • GMC Member
  • 98 posts

Posted 03 May 2011 - 06:55 PM

This looks pretty good, i might add this to the game i'm working on at the moment.
  • 0

#6 Dark Matter

Dark Matter

    RPG Expert

  • GMC Member
  • 3196 posts
  • Version:GM:Studio

Posted 03 May 2011 - 07:54 PM

You should have just moved the topic instead of making another...
  • 0

#7 Eddygp

Eddygp

    Horizhite Games

  • GMC Member
  • 216 posts
  • Version:GM8

Posted 23 June 2011 - 01:12 PM

good!!!
  • 0

#8 GVD

GVD

    GMC Member

  • New Member
  • 6 posts

Posted 04 July 2011 - 03:39 PM

Wow, this is great!!!
  • 0

#9 Sascha88

Sascha88

    GMC Member

  • New Member
  • 6 posts

Posted 17 August 2011 - 07:49 AM

Well,really good.. maybe the best thing i've found during the month!!

Edited by Sascha88, 14 June 2012 - 06:33 AM.

  • 0

#10 benja6678

benja6678

    GMC Member

  • New Member
  • 46 posts

Posted 13 February 2012 - 05:34 AM

Nice Engine! Very easy to use and understand.

Please keep this updated. It is absolutely awesome!
When will you update this?

Edited by benja6678, 13 February 2012 - 06:39 AM.

  • 0

#11 Dark Matter

Dark Matter

    RPG Expert

  • GMC Member
  • 3196 posts
  • Version:GM:Studio

Posted 13 February 2012 - 10:38 PM

When will you update this?

What more features would you want?
You have to have things to add to make updates.
  • 0

#12 benja6678

benja6678

    GMC Member

  • New Member
  • 46 posts

Posted 18 February 2012 - 02:37 AM


When will you update this?

What more features would you want?
You have to have things to add to make updates.


Namely this:

I'd like to be able to go to all directions not just 90, 180, 270, and 360, but it's good enough for me.

As Piluke said.
  • 0

#13 Dark Matter

Dark Matter

    RPG Expert

  • GMC Member
  • 3196 posts
  • Version:GM:Studio

Posted 18 February 2012 - 09:21 AM



When will you update this?

What more features would you want?
You have to have things to add to make updates.


Namely this:

I'd like to be able to go to all directions not just 90, 180, 270, and 360, but it's good enough for me.

As Piluke said.

Well, the more directions you have, the harder it is for users to draw a symbol "correctly". Maybe adding 45 degree increments could work, but anything more than that, and I don't think the system would work well.
  • 0




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users