## Swingers

bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

### Swingers

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
Swingers.love
Demo
.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)

bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

### Re: Gestures (name pending)

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

TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

### Re: Gestures (name pending)

Heh, any talk of having MULTI-gesture support in LÖVE?.

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

bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

### Re: Gestures (name pending)

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..

Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

### Re: Gestures (name pending)

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.)

TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Denver, CO
Contact:

### Re: Gestures (name pending)

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.

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

bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

### Re: Gestures (name pending)

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.

Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

### Re: Gestures (name pending)

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.

bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

### Re: Gestures (name pending)

Did you notice that ul is the same as up then left? And you can just make a u, getting nitpicky?

Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

### Re: Gestures (name pending)

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

    /
/
/

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 )