Detecting a Waggle

I spent a long while thinking and discussing with others how a waggle could be detected. Two I guess opposite ideas were proposed:

1. Sine wave mapping : This involves smoothing in the incoming data of “delta X” values and then mapping a sine wave to it, if the two overlap within a degree of tolerance, then a waggle exists.
2. Simple Threshold : This is simply, if the “delta X” value passes a set threshold then we are in a waggle.

There are issues with both approaches, firstly the Sine wave mapping sounds good, but if the user speeds up the waggle then the frequency of the wave changes, and the mapping doesn’t work. Secondly the simple threshold value doesn’t work, we’d need multiples of the them, as the “delta X” values go from positive to negative. We’d also need to account of the time difference between the two. So it is not as simple as we first thought. Another solution is required.

Temporarily a bit True

When a bit is roughly true, some of the time.

Imagine a jar, the top of the jar is completely open and sand can flow into it. The bottom of the jar has a small exit through which the sand must pass. Now imagine that upon this jar there is a line, a threshold. If the sand is above this line, then the jar is said to be true. If the sand is below this line, then the Jar is said to be false.

If we used, say 5 sand jars to record the waggle thresholds we would record in the first jar the fact that the “delta X” threshold has been passed by filling the jar up to it’s brim. We’d then move on to the next Jar and wait for the “delta X” to pass the opposite threshold. If the first jar was filled because the “delta X” value was above the positive threshold, then the next jar will only be filled if the “delta X” threshold passes the negative threshold.

We would continue to do this for each of the 5 jars, when we reach the last jar, we would move back to the first and repeat.

If we were to watch all the jars and if any three of the five jars where above the threshold, and true. Then we could say that ‘Yes, we are in a waggle’.

This approach is the time dependant threshold approach. Right now it’s a concept, and now I have to code it and check to see if works…

Getting the Waggle On

Development of the Waggle My Mouse application has been going well. I’ve over come a number of issues, I can now track the mouse pointer, and can capture the quick changes in the mouse pointers location. Two outstanding technical issues arise. These are:

1. How do draw a highlighted shape over the mouse pointer?
2. How do I know when the mouse has been waggled?

Detecting a Mouse Waggle

I’ve done some Windows programming before and I’ve a fairly good idea that I can draw a shape over the mouse pointer. The biggest unknown after that was trying to determine what a waggle is, and recognising when I saw one. I’ve a little test bed win32 application that I’ve been playing it. I’ve been using this application to complete my investigations on the practical ability I have to write a mouse waggle utility. I modified this test bed tool to record the mouse pointer locations, and the Delta-X; the difference in the position between the X coordinate of the mouse pointer now, and when it was last recorded. I managed to capture a bucket load of data describing what a mouse shake (or waggle) looks like. I imported this data into excel to let me visualise the waggle.

The shape of the waggle became really quite easy to see. The next question is “How do I write a bit of code which can detect that waggle?”. – Or at least that’s what I thought the question was.

Sharing the Waggle

I’ve a big fan of Justin Jackson with the Mega Maker podcast and Rob Walling and Mike Taber with the Startups for the Rest of Us podcast, and I was listening to them recently, when both shows made two really good points:

1. “How will I let people know about my idea?”

and

2. “How do I know what people think about my idea?”

That got me thinking.. “I really need to Share my Waggle”. So I bought wagglemymouse.com. Feel free to check it out, there is nothing there right now. My next job is to create some content which concisely describes my idea and why it is a good thing, and encourages people to sign up to an email list, or follow me on twitter for updates. That’s going to be my focus until the next Waggle my Mouse blog post.

Waggle my MegaMaker

Wow it is hard work to fit everything in. I’ve been working hard on progressing and investigating the two ideas I proposed last week;

• Waggle my mouse : Find your mouse pointer on Windows desktops with very high resolution monitors, or multiple displays.
• Social Media authorization for groups : Supporting the Brexit campaigns I’ve seen on Facebook who are struggling to all members of the group to access other resources, such as wordpress blogs etc.

Waggle My Mouse

This looked the most technically straight forward of the two ideas, and one with probably the easiest route to market. So this week I set up to investigate what APIs where available on Windows to track the mouse cursor. Now, I’ve done some win32 programming in the past so I thought “This can’t be too hard… right?”. Alas, as anyone who’s done win32 and ‘c’ programming knows, there are always twists in the tale. So I spend a number of hours chasing through the MSDN win32 documentation trying to discover how you track the mouse. In brief, it’s really easy to track the mouse if the cursor is moving over your application’s window, but if it isn’t – then it’s a bit more tricky. I discovered the rawinput APIs which are pretty cool. They give the raw input from the mouse device driver. I thought this would solve the problem, and it does and then it doesn’t.

RAWINPUT on Windows

While the rawinput API does give me information about the mouse, even when it is not over my application, it doesn’t actually tell me where the mouse is. The API gives the delta between the mouse’s last location, and its current location. This is great or detecting a “waggle” – as this is exactly what I would need to do, but it doesn’t tell me where on the screen the mouse is, or on multiple displays – which display. I’ve some more work todo.

WaggleMyMouse.com

Well on the basis on my hunch for implementing the idea I went out and bought the domain name anyway. I had a number of domains up for renewal and though, heck, I’ll get this one while I’m at it. I plan to setup a simple WordPress page, with a pre-bought template. I known that I can get a template that will hook up with mailchimp and provide me with a quick sign up mailing list. Now I’ve just got to go searching for that.

Before I do, I want to go searching for this silly Win32 API – talk about an itch I need to scratch, this technical issue about he mouse location is bugging me.

Social Media authorization for groups

I did some API investigation on this one. The core idea is that members of a specific Facebook group would be able to sign in to say, WordPress, and then would be provided access to the editor based on their group membership within Facebook. That way user access control is done by the Facebook group admins. Now, after checking I can see that all the APIs are there to do this, and it seems deceptively straight forward. However given all the trouble with the win32 idea, I’m wondering if it really is.

The goal of this plugin / tool is to support the existing Facebook groups. So I’ve a meeting this Wednesday with a group. It also happens to a brexit group, one I’d like to help anyway – perhaps I would be able to kill two birds with one stone? – I’ll have to wait and see…

Keep moving forward

Of the two ideas Waggle My Mouse looks like the idea with the least unknowns, both technically and route to market. So that’s the one I will follow for now.

I’m going to see how I can help the brexit group more generally, if anything comes out of that conversation which could be a candidate for my own MegaMaker challenge, then that’s a bonus.

Time challenge

The originally challenge from Justin was to launch something every week. That’s tough, especially while your holding down a day job – and I’m contracting at the moment, and have a young family to hangout with. But even doing the API investigations has engendered that love of technology and software development I have, and I’ve really enjoyed it.

Justin mentioned finding something that you enjoy doing – and this has been it.

And all the rest

In addition to the work I’ve done on these projects, I’ve also taken part in an AirRun – it’s a 5k race with adult style bouncy castle obsticals to cross. It was a huge amount of fun, and if you get the chance you should totally do it. It also reminded me that I need to get back and exercise. I’d eased off in the run up to my holidays, but I really do need to get back at it.

TextQuick and the Power of Software

At first I wasn’t too sure what to make of it. An email explaining that a mobile application I’d written had changed someone’s life. But it turned out to be the single best piece of user feedback I’ve ever had and probably the best email I’ve ever received. It all started with an ultimatum from my wife, and a desire to create an app which would “scratch my own itch”….

Email.. what?

Ok. So if you follow me on Twitter, or we are friends on Facebook, your probably wondering what all my posts about email etiquette are all about. – Well let me explain.. it all started with an idea, which popped into existence, as all good ideas do, while suffering from a hangover.