Page 1 of 3

Swingers

Posted: Thu Dec 10, 2009 2:40 pm
by bartbes
Here it is, Swingers, my new gestures lib, 0.6.0 (and probably works on 0.5.0 as well), enjoy everybody!

Also, it's MIT/X11 now.

Interface (in table "swingers"):
  • start(button) - 'starts' the subsystem, the button argument is the trigger button
  • checkError() - old, no longer used, but may be recommissioned
  • checkGesture() - check if there's a new gesture (ALWAYS do this before getting one, the getters aren't error-checked)
  • getGesture() - get a gesture string, uses, u for up, d for down, l for left, r for right, so rdul is right, down, up, left
  • getExtGesture() - gets an extended gesture table, contains n, ne, e, se, s, sw, w, nw, so {"e", "s", "n", "l"} would be the same as above
  • update() - call this every frame, does all the magic
Files:
swingers.lua
Lib
(3.77 KiB) Downloaded 1383 times
Swingers.love
Demo
(1.79 KiB) Downloaded 1695 times
Old download counts:
.lua: 148
.love: 303

Original post
----
Just today (about 1,5 hours ago) I felt like creating a gestures lib, well.. here it is. I've created a small tech demo for you guys, as of now I retain full copyright and I compiled the lib itself.
Before I get people complaining: This was because I wanted to get a demo out, the lib itself isn't ready for release yet.
Anyway, enjoy!

Oh, and I almost forgot to mention: 0.6.0 (EDIT: because it relies on some 0.6.0 features that can't be reproduced in 0.5.0)

Re: Gestures (name pending)

Posted: Thu Dec 10, 2009 3:24 pm
by bartbes
I got several complaints about errors in the package, so here one without the compiled file, I still own full copyright though!

EDIT: pulled, it turned out to be some hardware-specific problems

Re: Gestures (name pending)

Posted: Thu Dec 10, 2009 3:44 pm
by TechnoCat
Heh, any talk of having MULTI-gesture support in LÖVE?.

Nooooooooooo! Bytecode! Now I'll never know if any gestures are hiding.

Re: Gestures (name pending)

Posted: Thu Dec 10, 2009 4:51 pm
by bartbes
What?! The lib only passes what gesture has been used, it doesn't contain any gestures itself. And MULTI-gesture? Like multi-touch? There is only one mouse..

Re: Gestures (name pending)

Posted: Thu Dec 10, 2009 5:26 pm
by Robin
bartbes wrote:What?! The lib only passes what gesture has been used, it doesn't contain any gestures itself. And MULTI-gesture? Like multi-touch? There is only one mouse..
Can't... resist...
Innuendo... too... easy...

In other news:
I like the lib, especially that it recognises LRL, DLU and things like that. But full copyright? Bytecode? This is outrageous! I will file a complaint against you at the Society Againts Repressive Code Aggression Scare Mongering! (You might have heard of its acronym.)

Re: Gestures (name pending)

Posted: Thu Dec 10, 2009 5:43 pm
by TechnoCat
WARNING! THREAD HIJACK
You can have multiple mice on Windows 7.
http://www.wunderworks.com/teamplayer/
And multi-touch interfaces
But I understand the cross platform-ness of this wouldn't be all there.

THREAD RERAIL
I also like how the library keeps track of multiple movement directions in one click>release.

Re: Gestures (name pending)

Posted: Thu Dec 10, 2009 6:00 pm
by bartbes
Robin wrote:But full copyright? Bytecode? This is outrageous!
Take a break with your <spoiler>SARCASM</spoiler>, I will release it once it's ready.
TechnoCat wrote:I also like how the library keeps track of multiple movement directions in one click>release.
Well, yes, that's basically what it does, it is for the program to interpret those commands. Actually, you might have noticed that it returns a table with the directions, and the demo just uses table.concat to display it.

About the cross-platformness: I just found out that the code itself isn't cross-platform, so I'm going to have to create some checks, and if it fails make some stubs to just disable the gestures automagically.

Re: Gestures (name pending)

Posted: Thu Dec 10, 2009 7:33 pm
by Robin
bartbes wrote:
Robin wrote:But full copyright? Bytecode? This is outrageous!
Take a break with your <spoiler>SARCASM</spoiler>, I will release it once it's ready.
Sarcasm is how I roll. 8-)

Also, a feature request: to be able to to process diagonal actions, like ur, or dl, so you can make it recognize V-shapes etc.
If you don't want to implement it, please let me. :P

Re: Gestures (name pending)

Posted: Fri Dec 11, 2009 6:38 am
by bartbes
Did you notice that ul is the same as up then left? And you can just make a u, getting nitpicky?

Re: Gestures (name pending)

Posted: Fri Dec 11, 2009 8:16 am
by Robin
bartbes wrote:Did you notice that ul is the same as up then left? And you can just make a u, getting nitpicky?
I'm sorry, I wasn't clear... again. I meant ul, not u l.
ASCII art (sarcasm, again):

Code: Select all

    /
   /
  /
instead of:

Code: Select all

+-->
|
|
So we can do: / \ V W > < ^ etc.

And as I said before: I'd be happy to implement it if you don't want to (just give me the source ;))