Wiimote Project

Wiimote Projects => Wiimote Interactive Whiteboard => Topic started by: jarrodhook on January 09, 2008, 06:34:27 PM

Title: Right clicks with the Wiimote Whiteboard
Post by: jarrodhook on January 09, 2008, 06:34:27 PM
Hey everyone,

I'm Jarrod Hook - I posted over at the google blog, I am the dude who is setting it up at his work - but stilltrying to make the right click as easy as possible.

I posted some software called 'softright click' but sadly that didnt work for the Wiimote WB. :(

I even had autohotkey read the clicks, and indeed they are registered as 'Left clicks' from the wiimote WB, but it doesnt bring up the right click menu :( So, I was gutted.

However, this morning I had a idea, and have decided on the following;

-Right clicking needs to be easy and seperate to the 'always on' left click.
-I need a better IRLEd pen

So - one of New Zealands local suppliers, Jaycar eletronics, has the following for sale

Laser Pointer with Remote Presentation Control
http://www.jaycar.co.nz/productView.asp?ID=ST3108&CATID=&keywords=laser&SPECIAL=&form=KEYWORD&ProdCodeOnly=&Keyword1=&Keyword2=&pageNumber=&priceMin=&priceMax=&SUBCATID= (http://www.jaycar.co.nz/productView.asp?ID=ST3108&CATID=&keywords=laser&SPECIAL=&form=KEYWORD&ProdCodeOnly=&Keyword1=&Keyword2=&pageNumber=&priceMin=&priceMax=&SUBCATID=)

In short - 'This excellent device incorporates "Page Up" & "Page Down" buttons into a stylish laser pointer.' Hmm, I think to myself, interesting!
Its plug and play, no drivers, so, sadly, I cant change how the device itself works.....until I realised that AutoHotkey maker has a redirect keys option!!

So, I made a small little exe, and everytime I press Pagedown on the keyboard, it right clicks! Brilliant!! After this post I will go buy the pen and see if clicking page down on the pen will allow a right click on the screen.

(FYI - it has a little usb wireless unit that will plug into the pc I am using, no big deal)

I figure, I could remap the Pageup click on the pen to be a double click left - that will make it easy.

There are probably other things that can be done, but I think this might be a good idea, and wanted to share it.

I'll also modify the pen to its got the IR in the top :) So the staff here just hold down the middle button to drag the mouse, press one button for double click, and one for right click.

Comments welcome!


EDIT - UPDATE

I'm back from buying the pen. The pen itself isnt wireless, its actually IR! Damn this whole world is IR now :)
And indeed, you have to point the tip of the pen at the reciever, and it picks up your page up, or down.

But, with this autohotkey exe I made, it does a nice right click. Cool! Now, to try and open it and retrofit it with ANOTHER led :P It does cause a issue however, because its IR, and its a short IR flash, it moves the curser of the whiteboard! DAMN!! :)

Still, if I place the Wiimote in a way where it cant see the pointer, or something, I dunno. I'll work something out :)

-Jarrod
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: Shadwhawk on January 10, 2008, 01:39:42 AM
I'll chime in with my own right-click idea.

I disagree with Dice that the 'right' way to increase pen functionality is to introduce IR flashing.  I just don't think it'll be reliable enough for the complexity and expense it adds.

Adding lights is my simple, cheap, possibly-reliable solution.  Dice's objection to this is that the IR sources could get too close for the wiimote to differentiate, but that possibility is eliminated by removing the click lights from the IR pen.

The IR pen has one LED that's always on.  This is the cursor light, and the whiteboard software tracks it continually.  There is a thin wire leaving the pen to a 'sensor bar' that's placed somewhere in view of the wiimote.  The bar has 3 more IR LEDs in it, and the whole mess is wired in such a way so that pushing 3 buttons intsalled into the IR pen will light up the LEDs (push left click, light up one LED, right click, light up two LEDs, middle click, light up all 3).  The whiteboard software counts the total number of visible blobs and translates those into clicks.

The sensor bar can also hold the power supply, so you don't have to try and cram a battery into an expo pen.

Though, this introduces the problem of having to make sure you're not in the way of both the pen AND the bar.

If only there was a wireless nunchuck...
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: Luke on January 10, 2008, 05:23:54 AM
Shadwhawk, Your idea with the 3 leds in a sensor bar sound ok but why not expand the number of operations by using binary counting. Assuming all 3 leds off means no action there can still be a possible 7 actions. e.g.

LED1 LED2 LED3
0    0    0    -> No action
0    0    1    -> Left click 
0    1    0    -> Right click
0    1    1    -> Middle click
1    0    0    -> Mappable 1 (e.g. powerpoint blank screen)
1    0    1    -> Mappable 2(e.g. Exit full screen)
1    1    0    -> Mappable 3
1    1    1    -> Mappable 4

I doubt all these functions can be built into a pen but it is do-able in some presentation style control with a pointer.


I also see benifit in the pulses idea for this will conserve battery life by not requiring the led to always be on, and only required one led. I hope to look further into the possibility of pulsing the led, just have to get the code building and operational first, should not be too hard to determine the pulse width although it must be considered that windows has a timer granularity of 10ms, so a pulse should be at least 20ms wide.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: Nial on January 10, 2008, 07:02:59 AM
I disagree with Dice that the 'right' way to increase pen functionality is to introduce IR flashing.  I just don't think it'll be reliable enough for the complexity and expense it adds.


The advantage of some sort of modulation on the IR output and detection is that it keeps the
transfer of information down to single IR source and detection points.

You could have three modes, one for cursor tracking (like when you just move your mouse), one
for a left click and one for a right click. You would only have to ensure that the wiimote
was able to pick up the pen tip.

I'm not sure how easy this would be to add to the SW, do the bluetooth/wiimote drivers have a
good enough data throuput to allow PWM/PCM to be detected?

Adding this to the pen would involve a small uC (8 pin pic or similar) but this wouldn't be
difficult.

?

Nial.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: dice on January 10, 2008, 09:54:52 AM
Dice is the person that posted the comments, but Johnny is the one that is the original author.

Just clearing that up

I disagree with Dice that the 'right' way to increase pen functionality is to introduce IR flashing.  I just don't think it'll be reliable enough for the complexity and expense it adds.

;)
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: danchambers on January 10, 2008, 10:59:54 AM
Sorry - I appear to have posted this in the wrong section:

How about actually using a Wacom pen (or equivalent but cheaper wireless pen) - the pressure sensitive behaviour is measured in the tip of the pen, not the tablet itself, so you could just have the tablet plugged in but use the pen elsewhere. By using an IR led attached to a Wacom pen you'd solve the problem of pressure-sensitivity. It even has the side button for left and right click. Maybe one of the other pen/tablet combinations would work juat as well - like the Trust TB-4200, which is dead cheap.
Haven't tried it but it's worth looking into I think.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: Der Wichtel on January 10, 2008, 01:07:52 PM
Why not using a microcontroller?

You can build a very simple microcontroller board and programm it.
Like:
 right click : 3 times flashing ( Very short in milliseconds)
 left click  : allways on

you can also programm other codes like starting the media player or scrolling.

The Attiny25 from Atmel is small and you don't have to have much components to run it.

The only thing I can't do is to code a recognition programm. If someone wants to code the recognition software then I can make the code for the C.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: weck9406 on January 10, 2008, 07:04:59 PM
I have only just read through this topic and haven't done any research into it so correct me if I'm not following this correctly.  The basic challenge here is to find a way to add right click functionality to the white board.  So far, I have seen a lot of solutions that utilize additional LEDs to accomplish this.  My question is, could this also not be accomplished by using a second wiimote?  It has the button to utilize and it is not dependent on the first wiimote picking up the signal as it is tied directly to the Wii base unit via Bluetooth.

Just a thought.

Title: Re: Right clicks with the Wiimote Whiteboard
Post by: gabort on January 10, 2008, 07:26:54 PM
I think the problem is solved.

ZDNet has a writeup of the "Best of CES" and guess what I see... A wireless nunchuk. WiimoteLib already handles buttons C and Z, as well as the stick, and probably even the accelerometers.
http://ces.cnet.com/8301-13855_1-9843460-67.html (http://ces.cnet.com/8301-13855_1-9843460-67.html)
(http://i.i.com.com/cnwk.1d/i/bto/20080107/87027_WL_Nunchuck_72dpi.jpg)


So you can have the wireless nunchuck in one hand, and the pen in the other. Use one, or both buttons as a 'shift', so for example, if you press C and "click" with the pen at the same time, that could be a right-click.

In fact, I would change the control scheme so, that you MOVE the cursor with the pen, left-click with Z and right-click with C depressed.

What do you think, can we say this one is solved?
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: Luke on January 11, 2008, 03:22:32 AM
Gabort, I don't think the wireless nunchuck solves the issue. It is not a combined solution; it may be off the shelf but I think what the user would want is a pen that does all this. It may be possible to replace the wireless nunchuck with a wireless pen which communicates in the same way as the nunchuck but still uses the IR emitter to be tracked by the wiimote.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: gabort on January 11, 2008, 06:08:04 AM
I tend to disagree. The reason is, that you can (and would probably want to) solve this simply. Building a wireless pen, that has 3 buttons, all conveniently placed, that also communicates wirelessly with the wiimote seems hard. It is not something I would have a chance at pulling off at home really. Even if the communication was somehow possible, placing the buttons ergonomically in itself would be quite difficult.

On the other hand, the wireless Nunchuck seems to do this off the shelf. It has 2 extra buttons, can be held in your hand conveniently, and your existing "pen" with just one button will work nicely.

I have just one concern: range. But we'll see.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: Foob on January 11, 2008, 06:19:53 AM
I think the pwm idea for right click has some merit. It'll need to be a fairly slow flash since the wiimote only updates at 100hz, but that's fast enough to be usable. The tricky bit will be to synchronise the flashing with the wiimote framegrabs. I guess you could flash at 50hz to guarantee at least one frame with no blob in it between updates. Then you set your pattern recogniser to pick up all the possible temporal patterns that can result from that. If there's any overlap between flash patterns then just pick some different patterns.

This is a slightly harder problem than a simple IR remote control, since the IR detector in a TV detects the start of the flash pattern and automatically synchronises to it, but it should still be possible to figure something out.

Not sure about using microcontrollers here. Any chips small and cheap enough to use in the project will be surface mount and that'll add a fair amount of complication to building a pen. The beauty of Johnny Lee's project is in its simplicity!
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: Der Wichtel on January 11, 2008, 07:18:46 AM
I think the pwm idea for right click has some merit. It'll need to be a fairly slow flash since the wiimote only updates at 100hz, but that's fast enough to be usable. The tricky bit will be to synchronise the flashing with the wiimote framegrabs. I guess you could flash at 50hz to guarantee at least one frame with no blob in it between updates. Then you set your pattern recogniser to pick up all the possible temporal patterns that can result from that. If there's any overlap between flash patterns then just pick some different patterns.

This is a slightly harder problem than a simple IR remote control, since the IR detector in a TV detects the start of the flash pattern and automatically synchronises to it, but it should still be possible to figure something out.

Not sure about using microcontrollers here. Any chips small and cheap enough to use in the project will be surface mount and that'll add a fair amount of complication to building a pen. The beauty of Johnny Lee's project is in its simplicity!

100Hz means that the wiimote will update the picture every 10ms. To be sure, that the remote recognizes the flashing you can let the LED turn on for 20ms. So you have to do something like:
20ms on - 20ms off - 20ms on - 20ms off - 20ms on - 20ms off. ( which is what you have already mentioned 50Hz?)
Therefore you need 120ms for one rightclick. Of course you can also use less than 20ms but with 20ms you don't have to sync it with the Wiimote.

But 120ms is enough for a rightclick action. To be sure that the software will recognize the 3 times flashing, you can let the LED flash 4 times and program the recognition software to interpret a flash of at least3 times flashing as rightclick. So if one flash was not recognized the software interprets the rightclick too.

Yeah I have to admit that mikrocontrollers were not easy to solder without the right hardware.
But someone can produce some and sell them for 5$ or so. I think 5$ plus shipping is not much, isn't it?
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: zembahk on January 11, 2008, 07:54:45 AM
what if you just did some keybinding to the keyboard. click with like the f5 or f6. but the whiteboard would then have to just move the courser instead of the click and drag it does now.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: atomriot on January 11, 2008, 08:21:37 AM
how about this, what if you preset an area of your whiteboard to be the click area. so if you set it at the very top in the middle, any activity in that zone would send a mouseclick, otherwise you would send a mousemove. you could have 2 distinct zones

This would work because as long as you have your wiimote app calibrated, you could handle it in the mouse position processing. the mouse wouldn't move since it is set to read one of those zones. you could even draw something on the client desktop area so you can see where the zone is. or pop up a window at the same point after calibration. sure you would have to move away for clicks but i think this would be a good option with current hardware and software for the most part.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: Dan on January 11, 2008, 03:54:25 PM
I don't know much about how the wiimote works, so forgive this if it is dismissible out of hand.  Would putting an additional LED at the back of the pen (run by a thumb switch - as opposed to an index finger switch for the main LED) provide enough distance differentiation to serve as a right click signal?  Is the wiimote color sensitive?

For our app, pen point pressure sensitivity isn't an option (hanging projector screen) and the uses of an additional hand held device won't work (not "sexy").  Plus our CEO has to be able to use it, so we're pretty limited on the ease of use front.

Any merit to this idea?

Thanks to Johnny for a cool project and all of you for your support.
Dan
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: gabort on January 12, 2008, 11:51:36 AM
Well, I don't think that would work, if the 2nd. led is on the pen. The pen would normally (naturally) be held at a steep angle to the surface - close to perpendicular, and this could place the blobs close enough to be detected as one. In any case, the position of the sencond light would be a function of the angle of the pen as well, making this quite unpredictable.

Of course, you could have a 2nd. led hang out, perhaps be velcro-ed to the forearm of the speaker, but that does not sound too cool either. The pen would also be awkward, in my oppinion, if two switches would be attached to it.

Furthermore, how would you tell the software, which is the "cursor blob" from the tip of the pen, and which is only lit because you want a right-click? Since we do not have colors, a blob is a blob, so the one that lights up first will be the "cursor blob"...

I find a lot more merit in the idea (coincidentally my own) to have a second separate switch that signals clicks, and use the pen only to move the cursor around. The soon to be available wireless nunchuck is a natural solution in my oppinion, and I'll give it a go too, as soon as I can get my claws on one.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: atomriot on January 12, 2008, 08:43:37 PM
ok, what about this, idea number 2 from me.


this is my altered whiteboard app
(http://www.usao.edu/~alumcchittenden/whiteboard_app.png)

what the black box is, is the tracking box from the standard lib app. the red and green blobs indicate 2 different IR points. the green blob indicates the a point at RawMidX and RawMidY and is only drawn when (ws.IRState.Found1 && ws.IRState.Found2) which means 2 points

now where i am going with this is what if you had 2 pens or a pen and another IR source. if the point (RawMidX, RawMidY) were greater than say 20% of the distance of the screen you are working with apart, so for 1024x768 the distance between the 2 points is greater than 200 pixels) then it would initiate a right click.

the reason for the distinguishing if they are so far apart it because if they are too close, then it looks like 1 IR source. so you could have a pen or source in each hand.

not real classy sure, but its an easy idea to implement.

alternatively, in the project ideas section i described an idea for an app that does it backwards. wiimote in hand and a stationary IR LED. or multiple LEDs depending on the need of the application.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: weck9406 on January 13, 2008, 12:01:15 AM
I am in agreement with the camp that says to have 2 IR LEDs on one pen would end up looking like a single light.  Even if you were to angle them, I don't think you could get enough separation to distinguish 2 separate blobs.  But let's say, theoretically, that you could get the IR LEDs to direct their light such that you could get this 20% separation at a given distance away from the IR sensor.  You could potentially go further away that this distance, but you could not come closer since your separation would decrees to less that 20%.  At any angle, the further away you are from the source, the further the distance the projections would be from each other at the target.  The closer you are the closer the projections are to each other.  This would limit the usabilty to a given distance.

I know it is neat to have these theoretical discussions and try to find new and creative ways to do thing to try to circumvent the laws of physics and mathematics, but it is always best to keep things simple.  When you have tools at your disposal that can do the job (a second Wii controller connected via Bluetooth or the new wireless nunchuck) that aren't restricted by the problems faced using a sencond LED, why not use them?

Title: Re: Right clicks with the Wiimote Whiteboard
Post by: gabort on January 13, 2008, 12:59:21 PM
Hey atomriot, I noticed you have one more nice feature on this app of yours... how does the "all available screens" radio button work? (I have a double-screen setup too :) )

Care to share the app later on?
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: atomriot on January 13, 2008, 03:30:40 PM
oh yeah, i had to add that because we commonly just extend our desktop for our conference room and it initially only worked with the default screen.
this is my calibration form constructor from CalibrationFrom.cs
Code: [Select]
        public frmCalibration(bool useThis,int left,int top)
        {
            [color=red]this.Location = new Point(left, top);
           
            Rectangle rect = new Rectangle();
            Screen[] allScreens = Screen.AllScreens;
            int x = left;
            int y = top;
            int width = 0;
            int height = 0;
            if (Screen.AllScreens.Length > 1 && !useThis)
            {
                foreach (Screen screen in allScreens)
                {
                    if (screen.Bounds.X < x)
                        x = screen.Bounds.X;
                    if (screen.Bounds.Y < y)
                        y = screen.Bounds.Y;
                    if (screen.Bounds.Right > width)
                        width = screen.Bounds.Right;
                    if (screen.Bounds.Bottom > height)
                        height = screen.Bounds.Bottom;
                }
                rect = new Rectangle(x, y, width, height);
            }
            else
            {
                rect = Screen.GetBounds(new Point(left+1,top+1));
            }[/color]

            InitializeComponent();
            this.FormBorderStyle = FormBorderStyle.None;
            this.Left = rect.Left;
            this.Top = rect.Top;
            this.Size = new Size(rect.Width, rect.Height);
            this.Text = "Calibration - Working area:" + Screen.GetWorkingArea(this).ToString() + " || Real area: " + Screen.GetBounds(this).ToString();

            this.KeyDown += new System.Windows.Forms.KeyEventHandler(this.OnKeyPress);

           
            screenHeight = rect.Height;
            screenWidth = rect.Width;

            bCalibration = new Bitmap(screenWidth, screenHeight, PixelFormat.Format24bppRgb);
            gCalibration = Graphics.FromImage(bCalibration);
            pbCalibrate.Left = 0;
            pbCalibrate.Top = 0;
            pbCalibrate.Size = new Size(rect.Width, rect.Height);
           
            gCalibration.Clear(Color.White);

            BeginInvoke((MethodInvoker)delegate() { pbCalibrate.Image = bCalibration; });
        }

the changed part is pretty much everything before the InitializeComponent(); line.

this is my main form constructor

Code: [Select]
public frmMain()
{
            CheckForIllegalCrossThreadCalls = false;
            screenWidth = Screen.GetBounds(this).Width;
            screenHeight = Screen.GetBounds(this).Height;
            screenTop = Screen.GetBounds(this).Top;
            screenLeft = Screen.GetBounds(this).Left;

            if (Screen.AllScreens.Length > 1)
            {
                Screen[] allScreens = Screen.AllScreens;
                foreach (Screen screen in allScreens)
                {
                    if (screen.Bounds.Right > screenWidth)
                        screenWidth = screen.Bounds.Right;
                    if (screen.Bounds.Bottom > screenHeight)
                        screenHeight = screen.Bounds.Bottom;
                    if (screen.Bounds.Top < screenTop)
                        screenTop = screen.Bounds.Top;
                    if (screen.Bounds.Left < screenLeft)
                        screenLeft = screen.Bounds.Left;
                }
            }
            InitializeComponent();
            CanCalibrate = true;
}

and then i have the methods that handle checking if those radio buttons are selected

Code: [Select]
        private void btnCalibrate_Click(object sender, EventArgs e)
        {
            if (CanCalibrate)
            {
                if (cf == null)
                {
                    if (rdoBtnCurrent.Checked)
                    {
                        cf = new frmCalibration(true, Screen.GetBounds(this).Left, Screen.GetBounds(this).Top);
                    }
                    else
                    {
                        cf = new frmCalibration(false,0,0);
                    }
                    cf.Show();
                }
                if (cf.IsDisposed)
                {
                    if (rdoBtnCurrent.Checked)
                    {
                        cf = new frmCalibration(true, Screen.GetBounds(this).Left, Screen.GetBounds(this).Top);
                    }
                    else
                    {
                        cf = new frmCalibration(false,0,0);
                    }
                    cf.Show();
                }
                calibrationState = 1;
                doCalibration();
            }
        }

        private void Screens_CheckedChanged(object sender, EventArgs e)
        {
            screenWidth = Screen.GetBounds(this).Width;
            screenHeight = Screen.GetBounds(this).Height;
            screenTop = Screen.GetBounds(this).Top;
            screenLeft = Screen.GetBounds(this).Left;

            if (Screen.AllScreens.Length > 1 && !rdoBtnCurrent.Checked)
            {
                Screen[] allScreens = Screen.AllScreens;
                foreach (Screen screen in allScreens)
                {
                    if (screen.Bounds.Right > screenWidth)
                        screenWidth = screen.Bounds.Right;
                    if (screen.Bounds.Bottom > screenHeight)
                        screenHeight = screen.Bounds.Bottom;
                    if (screen.Bounds.Top < screenTop)
                        screenTop = screen.Bounds.Top;
                    if (screen.Bounds.Left < screenLeft)
                        screenLeft = screen.Bounds.Left;
                }
            }
        }


you also have to adjust the calling of the calibration

Code: [Select]
        public void doCalibration(){
            if (cf == null)
                return;
            int x = screenLeft;
            int y = screenTop;
            int size = 25;
            Pen p = new Pen(Color.Red);
            int crossX = 0;
            int crossY = 0;
            switch (calibrationState)
            {
                case 1:
                    crossX = (int)(screenWidth * calibrationMargin);
                    crossY = (int)(screenHeight * calibrationMargin);
                    x += (int)(screenWidth * calibrationMargin);
                    y += (int)(screenHeight * calibrationMargin);

                    cf.showCalibration(crossX, crossY, size, p);
                    dstX[calibrationState - 1] = x;
                    dstY[calibrationState - 1] = y;
                    break;
                case 2:
                    crossX = screenWidth - (int)(screenWidth * calibrationMargin);
                    crossY = (int)(screenHeight * calibrationMargin);
                    x += screenWidth - (int)(screenWidth * calibrationMargin);
                    y += (int)(screenHeight * calibrationMargin);
                    cf.showCalibration(crossX, crossY, size, p);
                    dstX[calibrationState - 1] = x;
                    dstY[calibrationState - 1] = y;
                    break;
                case 3:
                    crossX = (int)(screenWidth * calibrationMargin);
                    crossY = screenHeight - (int)(screenHeight * calibrationMargin);
                    x += (int)(screenWidth * calibrationMargin);
                    y += screenHeight -(int)(screenHeight * calibrationMargin);
                    cf.showCalibration(crossX, crossY, size, p);
                    dstX[calibrationState - 1] = x;
                    dstY[calibrationState - 1] = y;
                    break;
                case 4:
                    crossX = screenWidth - (int)(screenWidth * calibrationMargin);
                    crossY = screenHeight - (int)(screenHeight * calibrationMargin);
                    x += screenWidth - (int)(screenWidth * calibrationMargin);
                    y += screenHeight -(int)(screenHeight * calibrationMargin);
                    cf.showCalibration(crossX, crossY, size, p);
                    dstX[calibrationState - 1] = x;
                    dstY[calibrationState - 1] = y;
                    break;

everything after this in the DoCalibration() method is default. so dont just replace that entire method because then you wont get the case 5 or default

thats pretty much it. basically it should check which screen it is using. you have to pass a bool into the calibration form to tell it to use multiples or not.

hopefully this works for you, i might have left something else out but if so then let me know. it was fun to figure out and is definitely worth digging through the code because it gives you a better understanding of it.

once i get the project done and cleaned up, perhaps it can be put up on the download section as a supplemental project. I could not have gotten this far without Johnny's work, thats for sure.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: gabort on January 14, 2008, 07:05:11 AM
Thanks for posting!
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: troy59 on January 14, 2008, 01:16:30 PM
i'm not quite sure i understand this, but if i understand what you were saying, you need 3 other IR's to tell the wiimote to right click? If that is so, then you could have the pen in one hand, then a glove on the other with and IR led on the back of a finger. Gloves look cool and futuristic if made right, and y 3, you could just as well use 1 other IR if it was far enough away for the wii mot to distinguish inbetween the two dots, If you had the glove with the led on the back, you just make a swith on, say, your pointer finger, you could even make a switch out of tin foil and two pieces of wire. So, basically, you have a glove with a led on the back of it, and your pen in the other hand, then when you activate the led on your hand, the wii remote will see it and make a right click.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: atomriot on January 14, 2008, 01:46:12 PM
if your are talking about my 3 IR source idea, i say that with the assumption that the primary source is not actually clicking the mouse. you have one source that just moves it, then others that handle clicks. this could be narrowed to just two if you light pen does the clicking and moving at the same time.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: bryanarby on January 14, 2008, 01:53:08 PM
As posted in here: http://www.wiimoteproject.com/project-ideas/non-drag-and-drop-mouse-with-lmb-and-rmb-t128.0.html

this could give the solution when using Wiipens (that's how I named em/I refer to em) on USB feed. By using micro controllers pics to "create" the mouse click signal you would get a extreme flexible Wiipen.
Pro: having more functions.
Con: the size of pen will increase /w each extra function.
I'll try and get the data round up before friday, saturday tweak time, monday is next test day.
Data needed: the signals for Left and right mouse button, hook em up to a osciloscope on paths D- and D+.
For info about what is what on usb cable:
http://pinouts.ru/Slots/USB_pinout.shtml
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: thesilentpyro on January 15, 2008, 09:22:27 AM
I think some people here are missing a few facts (not to put anything down, I'd just like to point some things out).  One: Multiple LEDS on a pen is not a very feasible idea; there are too many variables the software cannot account for--namely, angle.  Angle the pen is held if there is an LED on the back.  Angle the Wiimote is viewing the plane from.  Angle of the user's arm.  Angle of rotation of the pen if the LEDs are at the tip.  Too much.  Two: Three selling major points of this project are simplicity, portability, and low-cost; the original project really only require a Wiimote and a <$6 LED pen that is assembled relatively easily.  Meets all the points.  Microcontrollers, additional peripherals, corded controllers, things in the off-hand--all these infringe on the selling points.  Three: People are stupid.  Granted, if they can get this project to work, they're undoubtedly on the upper half of the bell curve, but you cannot give people too many things to do and expect them to do it all correctly.

Personally, I'm an advocate of software-driven right-click.  The "click area" idea is a feasible one I think--if you want an "always on" cursor, get a second pen and use the multipoint capabilities to have one hand controlling the mouse and the other clicking.  I also really liked the timed-click aspect; that is how older Macs worked with popping up alternate menus, and that survived pretty well for a while.  The system, which I imagine wouldn't be very hard to implement since we already have mouse-emulation in effect, is that if the pen is moving, it's a click-and-drag.  If it's stationary and only appears for a short time, say under two seconds, it's a left-click.  If it's stationary and appears for more than two seconds, it's a right-click.  I know it's not ideal for a lot of things, including most games, but let's face it; the whole interface is not ideal for most games.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: bryanarby on January 15, 2008, 09:54:40 AM
Two: Three selling major points of this project are simplicity, portability, and low-cost; the original project really only require a Wiimote and a <$6 LED pen that is assembled relatively easily.  Meets all the points.  Microcontrollers, additional peripherals, corded controllers, things in the off-hand--all these infringe on the selling points.  Three: People are stupid.  Granted, if they can get this project to work, they're undoubtedly on the upper half of the bell curve, but you cannot give people too many things to do and expect them to do it all correctly.

well 1 I dont disagree.., 2: cheapest pic is less then one euro..,3 Thats why there should become pre-made pens available and some sort of manual ^^
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: troy59 on January 15, 2008, 10:28:42 AM
1. I agree you should use it like the macs button(they still use it) 2. Its very simple to make, but you could manufacture a $5 pen 3. Most average people are pretty stupid, they don't even know what a usb is, so a manual would help the average human being would need one, i know my dad is stuborn enough to use one, "they put them in here for a reason"
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: The Rick on January 15, 2008, 12:18:54 PM
I had an idea for a right click that I thought up while using my phone the older day.  In order to utilize a right-click with the stylus, you pressed onto the screen until a series of lights lit up, then the right-click menu appeared.  Could some code be created that runs either simultaneously, or even built in, with the WiiMote Whiteboard software, that utilizes this functionality?

This way, you can still click and drag around to highlight or move windows, but if held in place, it brings up the light sequence to activate the right-click menu (or action)?
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: bryanarby on January 15, 2008, 12:56:05 PM
well the point and hold is what mac idea is about ^^
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: Der Wichtel on January 15, 2008, 01:06:50 PM
Another solution is the right click on Windows Mobile devices.
You tab and hold the screen and then dots appear in a circle. when the circle is full then the action is interpreted as rightclick.
works pretty well
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: troy59 on January 15, 2008, 02:13:47 PM
i have a wacom tablet and it utilizes something like Rick said, when you hold down the button a circle will fill up, and once its filled up, the right click menu will open
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: The Rick on January 15, 2008, 04:54:14 PM
Another solution is the right click on Windows Mobile devices.
You tab and hold the screen and then dots appear in a circle. when the circle is full then the action is interpreted as rightclick.
works pretty well

Yes, this is what I was referring to...
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: gabort on January 16, 2008, 07:50:46 AM
I got some more info on the NYKO Wireless Nunchuck. The price will be around 30 USD, not prohibitive. I am a little concerned about the range though. This is a point I have been worrying about, and it seems on the edge. They quote it to be 3 meters, which is OK most of the time. I guess you can find a place for the Wiimote on the edge of that range that will cover a fairly large viewing area.

A little trigonometry, where the Wiimote is placed at 45 degrees from the furthest point of the screen (300 cm away) will allow the wiimote to "see" an area 212 cm wide. Not Jumbo, but fair enough.

(http://kepfeltoltes.hu/thumb/080116/trigonom_www.kepfeltoltes.hu_.jpg) (http://kepfeltoltes.hu/view/080116/trigonom_www.kepfeltoltes.hu_.jpg)
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: bryanarby on January 16, 2008, 09:10:03 AM
Nice idea, but we around here seek cheap solutions ^^
well i did some digging... why not take out the parts from a mouse that do the LMB/RMB clicks? I mean that's one chip and 2 nice, neat click buttons... i'll come back on the wireing later on. (still have to figure that out)
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: troy59 on January 16, 2008, 09:58:15 AM
make sure you get a wirless one though, a corded opne would suck....i'll see if i can do some digging also, probably not, i've been swamped with homework, but oh well
Title: Software Utility Solution?
Post by: megatherium on January 18, 2008, 09:56:33 AM
I think a fairly simple solution to the problem, although maybe not as elegant as a hardware based pen one is the freeware utility called Dmouse.  Run the utility and a window pops up with a mouse graphic in it.  The current selected mouse button is darkened. Pen touch the graphic and it switches to a right click. Tap it again and you switch back to left click. A nice feature is the "switchback mode". Do a right mouse click and after you've completed the selection it automatically switches back to left click.  Pretty slick. Problem solved and you don't get much cheaper than free.  John
 
Title: Re: Software Utility Solution?
Post by: atomriot on January 18, 2008, 10:30:55 AM
I think a fairly simple solution to the problem, although maybe not as elegant as a hardware based pen one is the freeware utility called Dmouse.  Run the utility and a window pops up with a mouse graphic in it.  The current selected mouse button is darkened. Pen touch the graphic and it switches to a right click. Tap it again and you switch back to left click. A nice feature is the "switchback mode". Do a right mouse click and after you've completed the selection it automatically switches back to left click.  Pretty slick. Problem solved and you don't get much cheaper than free.  John
 

alternatively, this could be easily incorporated into the current application. pretty good idea. comes back to my initial idea of having specified areas to control clicks.

heck, you could even have 3 areas, 1 says make it just mouse move, another says make it left click and another says make it right click.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: Der Wichtel on January 18, 2008, 10:48:48 AM
I'm still thinking the windows mobile solution is the best, because it does not need any extra area for rightclick.
Title: Re: Software Utility Solution?
Post by: bryanarby on January 18, 2008, 10:51:50 AM
I think a fairly simple solution to the problem, although maybe not as elegant as a hardware based pen one is the freeware utility called Dmouse.  Run the utility and a window pops up with a mouse graphic in it.  The current selected mouse button is darkened. Pen touch the graphic and it switches to a right click. Tap it again and you switch back to left click. A nice feature is the "switchback mode". Do a right mouse click and after you've completed the selection it automatically switches back to left click.  Pretty slick. Problem solved and you don't get much cheaper than free.  John
 

alternatively, this could be easily incorporated into the current application. pretty good idea. comes back to my initial idea of having specified areas to control clicks.

heck, you could even have 3 areas, 1 says make it just mouse move, another says make it left click and another says make it right click.

Do make it move in areas then :) because when your in just move there isn't a way of clickin xD
Title: Re: Software Utility Solution?
Post by: atomriot on January 18, 2008, 01:24:58 PM
Do make it move in areas then :) because when your in just move there isn't a way of clickin xD

yes, but if your pen is in a specific area, the behavior could change so that it doesnt send a mouse move so if you click in that area, it will change the behavior.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: troy59 on January 18, 2008, 02:23:06 PM
i think we should use macros. You click on the right click macro and it will simulate a right click next time you click then  itll switch automatically back to left click
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: atomriot on January 18, 2008, 08:11:34 PM
here is my idea of the special area to go over in action

http://www.wiimoteproject.com/videos/whiteboard-app-with-left-click-right-click-or-move-only-t207.0.html
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: Der Wichtel on January 19, 2008, 01:23:50 PM
Windows Vista has a Tablet-PC application. Why not use that?
I have tried that, with my mouse, but Windows says I have to use a pen. My thoughts are, if we can manage to use the mouse with the Tablet-PC application, then we have rightclick, scrolling and other mouse gestures.

Some kind of stylus emulation with mouse input
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: troy59 on January 19, 2008, 05:49:58 PM
that would work for windows vista users, but us that still have xp would have to use something else, like this http://www.polital.com/pnc/ or something of the sort, but that is a good idea if you have vista
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: Der Wichtel on January 19, 2008, 06:10:37 PM
It is also possible with Windows XP. Microsoft has released a tool that does the same. You just have to download and install it
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: serych on January 20, 2008, 12:56:32 PM
I'm totaly newbie in Wiimote WB, as I have bought my Wiimote just today. But I think that rightclick could have a pretty simple solution.
If the sampling period of Wiimote is 10ms, what we need for the right click is let's say 15ms IR flash to make sure, that Wiimote has caught it. This means, that wiimote will return 1 or max 2 samples with IR on. On the other hand it is necessary to ensure, that left click  will take longer to 30ms.
On the side of IR pen it is an easy task for some microcontroller (I'll try to construct it with PIC10F202 in the next days).
On the side of Windows it is just the question of recognition of the  length of IR LED on-state.

Jakub

 
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: bryanarby on January 20, 2008, 04:18:52 PM
plz keep in mind we seek a simple, cheap solution. programming pics isn't something any one can do :)
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: paul.urban on January 21, 2008, 02:45:01 AM
There was another post that questioned Johnny's statement that the frame rate of the Wii's IR camera is 100 Hz, roughly the same as the rate at which it sends reports over Bluetooth. That post stated that the PixArt camera used in the Wiimote has a frame rate of 30 Hz. This question is quite important for anyone building in a right-click using a flashing code.

I built a simple flasher circuit using a 555 timer IC with some pots and hacked the whiteboard app to display a basic "oscilloscope trace", high for IR point detected and low for no IR point detected. The trace takes 16 seconds to cross the form, with a width of 1280 pixels. That is 80 reports per second. I found that I could increase the frequency of the IR pulses to the point where the Wiimote would reliably show a "high" signal for 1 to 2 reports. Any frequency above this would result in very obvious aliasing, with the signal switching between longer periods of high and low. The aliasing must indicate that the frequency was approaching the frame rate of the camera.

This seems to confirm that the camera operates at a frame rate closer to 100 Hz than 30 Hz, and this should be really good news for anyone wanting to use flashing codes.

I did some experimentation and found that the maximum rate at which one can double-click is about 10 Hz. This is relevant because we don't want a double-click to register as a right-click.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: paul.urban on January 21, 2008, 02:59:13 AM
I'm planning to build a simple circuit where a continuous on signal is a left-click, and a fast flashing signal (say around 15-20 Hz) is a right-click. The trick is going to be hacking the whiteboard app to recognize the right-click reliably. Some people asked about syncing the pen with the Wiimote. This is impractical. As long as the flashing frequency is far enough below the frame rate of the camera and the rate at which the Wiimote sends reports (i.e. below about 15 Hz), all that you have to do is make the software cater for the fact that a pulse may be detected and reported for either 1, 2 or 3 "pen on" reports.

It is impossible to click continuously at anywhere near this rate (by a factor of 5 or so), so it should be easy to distinguish a fast double-click from a right-click flashing signal.

Another very nice feature to have would be a middle click, useful for scrolling in a browser without running to the far right edge of the screen each time! I'm thinking that a small microcontroller may be the best solution here, allowing us to generate various codes quite flexibly, while minimizing the number of components.

Now to learn PIC programming...
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: Nial on January 21, 2008, 06:58:11 AM
There was another post that questioned Johnny's statement that the frame rate of the Wii's IR camera is 100 Hz, roughly the same as the rate at which it sends reports over Bluetooth. That post stated that the PixArt camera used in the Wiimote has a frame rate of 30 Hz. This question is quite important for anyone building in a right-click using a flashing code.



The IR camera in the wee remote only has to detect and report blob positions, I have read that this
is done by dedicated 'on sensor' logic so 100Hz is probably feasible as you've found.


Nial.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: serych on January 21, 2008, 03:05:11 PM
plz keep in mind we seek a simple, cheap solution. programming pics isn't something any one can do :)
Yes it is! I already have etched printed circuit board with dimensions 8 x 28mm and all the schematics consist only from 5 components: PIC10F202 (which you can purchase as a free sample), one SMD resistor, IR LED and 2 buttons. Now I'm working on building this "simpletronics" into Edding 360 whiteboard marker and after that I'll start with PIC programming. After debugging I'll publish all the information including all the files needed on my web. The only problem for other people will be to find someone with the PIC programmer to burn the hex file into the PIC.

Jakub
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: Der Wichtel on January 22, 2008, 01:49:39 PM
I have already programmed a µC. It flashes with 20ms to be sure that every flash can be recognized. The setup is a little bit big, since I am using the µC board as stroboscope with high power LEDs.

Burning will not be that problematic. You can use the serial interface on your pc to emulate a burning devive. Of course it will be slower to write/read ...

The only thing I'm missing is the recognition software ;P
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: megatherium on January 22, 2008, 02:01:00 PM
It is also possible with Windows XP. Microsoft has released a tool that does the same. You just have to download and install it

Really?  Where is this tool?  Will it work with XP home or only Tablet PC edition.  Thanks.  John
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: frozenlyse on January 22, 2008, 10:52:04 PM
personally i am going this route
http://h10010.www1.hp.com/wwpc/id/en/sm/WF06c/A1-1697201-1698431-1698431-1698473-1698473-78019431.html

i bought 10 of these bluetooth (thin!) mice for $6 each. they weigh 42g each!

i want to wire up an IR led to run continuously off its battery so instead of the IR flash being a mouse click, the IR is constantly on setting the mouse position

the left and right click are built into the mouse so its a simple solution!
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: troy59 on January 23, 2008, 10:48:14 AM
but then it defeats the purpose of using a pen. Thats what the whole origional design was about, if you managed to take the mouse apart and then make it into a pen then i'd clap for you :)
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: Helza on January 23, 2008, 01:01:55 PM
Exactly, then its easier to use the WiiRemote as its normally used, in your hand and the ir leds at the screen.. :) then you got a whole lot more buttons & the accel. functions :):P
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: troy59 on January 23, 2008, 03:12:33 PM
We've talked about that before, but the idea didn't seem to stick, and personally, i think that would be great, you press the a or b button for left and right click, then you've got 5 other buttons to use, the +,-, home, 1, and 2 buttons. But the idea is probably gonna get lost again like last time, oh well, only hoping :)
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: Helza on January 23, 2008, 03:17:46 PM
troy59: What idea do you mean? Do you mean using the wiiremote itself as the mouse? Or do you mean something else? Because thats exactly how the WiiRemote operated without any hacks/mods :)
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: troy59 on January 23, 2008, 03:33:24 PM
using the wiimote itself as the mouse. We've brought up that idea before on this forum but it kinda faded away.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: ZaPPZion on January 23, 2008, 05:16:59 PM
well, that definately is possible, but the whole thing that's awesome about the whiteboard, is that you dont have to hold the wiimote anymore. You just need to have an IR pen, that's it;)
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: troy59 on January 23, 2008, 05:51:31 PM
that is exactly true zapp
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: Helza on January 24, 2008, 04:29:42 AM
I'm currently using the WiiRemote as a remote mouse, but only because i'm still waiting for my IR parts (using candles for the IR tracking, but i'm not gonna put those on my head or pen) so i can use it as whiteboard & headtracking as well :(

Using it just as an wireless pointer/mouse works perfectly for watching movies & pictures on the bigscreen :)




Title: Re: Right clicks with the Wiimote Whiteboard
Post by: gabort on January 31, 2008, 12:42:01 AM
In case it escaped your attention, there is a new set of controlers coming out for the wii (read: 3rd Party). The wireless nunchuck is coming... with two buttons on it... one for left, and one for right clicks...

http://www.sunflex-europe.com/fileadmin/galerie/v/snakebyte/Nintendo+Wii/Wireless+Nunchaku/
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: Thisisjon on February 07, 2008, 05:29:12 PM
Ok, Ive been reading through all the posts and maybe I am mis-understanding something, but wouldnt the easiest way to get a right click just to be with another led. No flashing or anything like that but essentially you just need two IR pens or just a second led somewhere. The wiimote just sees dots of IR light right? So if it sees one dot its a left click if it sees two its a right click?

I think thats pretty simple and I don't see why it wouldn't work.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: aanoo on February 08, 2008, 01:59:31 AM
Hello, ALL
Please I am new to the Forum & found the project very interseting. Though I have not went through the code or tried the WhiteBoard application. I have a small question.
== How the left mouse click is trigerred via IR pen?, Is it Always pressed or when Push Button on the pen is pressed triggers the Left Click.

Thanks in advance for the response.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: ZaPPZion on February 08, 2008, 02:18:14 AM
push button triggers the left click.
@Thisisjon: Most pens that have been made so far did prove it's not that handy the way you describe it. The wiimote picks up 2 IR blobs when you're holding the pen at certain angles. That would mean unexpected/wanted clicks. That's why everyone is talking about this flashing;)
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: atomriot on February 08, 2008, 08:42:43 AM
Hello, ALL
Please I am new to the Forum & found the project very interseting. Though I have not went through the code or tried the WhiteBoard application. I have a small question.
== How the left mouse click is trigerred via IR pen?, Is it Always pressed or when Push Button on the pen is pressed triggers the Left Click.

Thanks in advance for the response.


it is by default. you can change the behavior but that is one of the most talked about topics on the board is figuring out a good way to do clicks in a controlled manor. I personally have altered the software as demonstrated in my youtube video of a box you simply mouse over to change the behavior from right click to left click to move only but there are many great and ambitious ideas on here.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: Thisisjon on February 08, 2008, 11:43:37 AM
The wiimote picks up 2 IR blobs when you're holding the pen at certain angles. That would mean unexpected/wanted clicks. That's why everyone is talking about this flashing;)

Would there be a way to eliminate getting multiple signals from a single LED? Because the idea of this is simplicity right? Having to get a blinking led that blinks at a certain speed at certain times doesnt seem simple to me, fun to mess with sure, but not simple. I would think a filter or higher powered LED would help eliminate getting multiple signals.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: Der Wichtel on February 08, 2008, 11:48:11 AM
The wiimote picks up 2 IR blobs when you're holding the pen at certain angles. That would mean unexpected/wanted clicks. That's why everyone is talking about this flashing;)

Would there be a way to eliminate getting multiple signals from a single LED? Because the idea of this is simplicity right? Having to get a blinking led that blinks at a certain speed at certain times doesnt seem simple to me, fun to mess with sure, but not simple. I would think a filter or higher powered LED would help eliminate getting multiple signals.
High Power LEDs won't solve the problem either.
If the distance between surface and ir-pen is too great then there will be two ir dots.
One is the reflection on the surface and the other on from the led.

I'm using a tap and hold function as rightclick but it is very buggy because I'm not a very good programmer.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: xodmadhatter on February 14, 2008, 06:13:10 PM
how about this for an idea (it is more hardware based but might still work):
NOTE: this is all theory as i have not tested it yet.  i am just putting the idea out there

take a mini mouse like the ones people use for their laptop while travelling take out the board(s) and insert them into a largish marker case. you would need to remove the LED that is used for tracking replace it with an IR LED and move it to the tip. with a little further modification you can have all of your standard mouse buttons (Left, Right, and Middle Wheel) all at your finger tips on the pen. this way the plug and play drivers for most all mice and even the specific drivers for the mouse you use can control Left Click, Right Click, and even Scroll Wheel. From here all that is needed is a modification of atomriot's program that only moves the cursor.

as i have not tested this yet i do not know how well this will work and the biggest problem i forsee will come from calibration (although this also stems from the fact that all of what i stated is theory as i have not yet used any of the software yet) because what i have seen so far is that you have to blink the LED ad each of the four points.

for anyone worried about the cost increase of using this idea here are estimated increases in the cost of the pen based on the type of mouse you use (all refer to mini mice):

wired: ~$5-$10
RF wireless: ~$10-$20
Bluetooth: ~$20-$50

these cost increases also depend on where you get the mouse from


please give feedback on what you think the feasiblity of this idea is and possible improvements or major problems.

thank you
xodmadhatter
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: slntdan on February 14, 2008, 08:14:34 PM
Ok, Ive been reading through all the posts and maybe I am mis-understanding something, but wouldnt the easiest way to get a right click just to be with another led. No flashing or anything like that but essentially you just need two IR pens or just a second led somewhere. The wiimote just sees dots of IR light right? So if it sees one dot its a left click if it sees two its a right click?

I think thats pretty simple and I don't see why it wouldn't work.

This idea makes the most sense to me.  It seems much easier to modify the way you hold the pen than to modify a wireless mouse or program a microchip. (e.g. I hold the pen with my right hand, so i'll place the wiimote on the left side of me.  One LED on each end of the pen should give plenty of space between the two, right? like in the finger tracking video?)

But how would the software know wich LED to track?

I like the brainstorming session here guys. (thumbup)  :)
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: defray on February 19, 2008, 07:40:14 AM
Ok, I'm new to the WiiMote Project and this was possibly mentioned before, but couldn't you just do the following, without the need of a micro controller and with 1 single LED:
Just wire your Pen with parallel 2 circuits and two buttons (one for activating each circuit).
- Circuit 1 just lights the LED as usual (Left Click)
- Circuit two lights the LED though a RLC-Circuit:
http://en.wikipedia.org/wiki/RLC_circuit (http://en.wikipedia.org/wiki/RLC_circuit)
With the right dimension of the components, wouldn't one basically be able to achieve an AC current in the 50Hz range?
Then the LED would only light with each "up" wave, and thus be blinking with 50Hz as desired ...
 I don't know if it would work and I can only try it in about 1-2 weeks as I'm busy with exams atm. (As an electrical engineering student this idea just sprung my mind ...)

If I'm talking serious BS here, feel free to correct me ...

My other approach would be to use one LED ont he tip of the pen and one on the back and do this 2 point-identification stuff. I guess both LEDs wouldn't be covered and would be spaced the right distance of each other, not to be mistaken as one blob of light.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: lderooy on February 21, 2008, 06:07:46 PM
I am new here and just read through this post.  If one is concerned about the complexity of programming a pic microcontroller, one option is to use the arduino - which has a usb interface and several i/o ports for various sensors and I have found quite easy to program (no special tools required). 

If people are suggesting the microcontroller to generate the flash then you could put the arduino in a box with a battery pack in your pocket and have a small wire connecting to the pen (as in Jimmy's video).  If you need the microcontroller to pickup the flashing signal then one could have the sensors mounted next to the wiimote and have it pick up the flashing and send a signal to the program through a usb port.

Title: Re: Right clicks with the Wiimote Whiteboard
Post by: pfigueiredo on February 22, 2008, 11:42:46 AM
Im not into programming c+ at all so my best try into this right/left click will be to attach the insides of a 10 wireless mouse to the back of a pen.
It sure isnt going to look pretty but it solves the battery case problem and clicking all at once. And the PIC/arduino solutions would be bulkier I think.
Will post some pics when im done with it if anyones interested.

(hope you c+ guys come up with some sleek double led solution...great discussion here)
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: Thisisjon on February 27, 2008, 12:00:22 PM
how about this for an idea (it is more hardware based but might still work):
NOTE: this is all theory as i have not tested it yet.  i am just putting the idea out there

take a mini mouse like the ones people use for their laptop while travelling take out the board(s) and insert them into a largish marker case. you would need to remove the LED that is used for tracking replace it with an IR LED and move it to the tip. with a little further modification you can have all of your standard mouse buttons (Left, Right, and Middle Wheel) all at your finger tips on the pen. this way the plug and play drivers for most all mice and even the specific drivers for the mouse you use can control Left Click, Right Click, and even Scroll Wheel. From here all that is needed is a modification of atomriot's program that only moves the cursor.

as i have not tested this yet i do not know how well this will work and the biggest problem i forsee will come from calibration (although this also stems from the fact that all of what i stated is theory as i have not yet used any of the software yet) because what i have seen so far is that you have to blink the LED ad each of the four points.


Im messing around with this idea now. It seems much more practical because you wouldnt need a wiimote and there would be much less connection compatibility issues. The problem, like you said, is calibration. I messed around with just using a mouse on top of a computer screen. The cursor moves much faster than the mouse, with my settings, but with some tweaking, its easy to get the cursor to move exactly with the mouse. Its easy to draw with and use just like you would use the IR pen/wiimote. Im still trying to take off certain parts of the mouse and fit it into a pen.

All in all, I think this is a much better solution for a projected whiteboard than using a wiimote, but I could be missing something, that seems to happen a lot.
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: lderooy on February 27, 2008, 08:53:23 PM
Thisisjon,

I think that what you are talking about is not quite the same as what I thought xodmadhatter was thinking:

I thought the idea was this:   Take a wireless mouse and remove/disable the mouse tracking portion of the mouse (the red LED) so you now have a mouse that does not register the motion but only the mouse clicks.  Then take an IR led and mount it to the mouse in some fashion such that the wiimote can read it's motion.   You would then use the wiimote software to register the calibrated location of the IR led and intrepid it as the mouse location.  You would then use the wireless mouse and it's wireless connection to the computer to register the mouse clicks. 

You could also accomplish this by holding the wireless mouse in one hand to click and hold an IR pen in the other to write with. - If you did this then maybe all you would have to do is cover the wireless mouse Red led with some tape.

Your suggestion of using a wireless mouse by moving it along the surface of the whiteboard would not work because a typical mouse records it's motions relative to where it was - for example you can pick up a mouse and move it to a new location and the cursor does not move.  You would need the wiimote with it's calibration points to track the location in space.


My wiimote should come in sometime next week so I can try this out....
Title: Re: Right clicks with the Wiimote Whiteboard
Post by: insomnia on February 28, 2008, 07:53:29 PM
Thisisjon,

I think that what you are talking about is not quite the same as what I thought xodmadhatter was thinking:

I thought the idea was this:   Take a wireless mouse and remove/disable the mouse tracking portion of the mouse (the red LED) so you now have a mouse that does not register the motion but only the mouse clicks.  Then take an IR led and mount it to the mouse in some fashion such that the wiimote can read it's motion.   You would then use the wiimote software to register the calibrated location of the IR led and intrepid it as the mouse location.  You would then use the wireless mouse and it's wireless connection to the computer to register the mouse clicks. 

You could also accomplish this by holding the wireless mouse in one hand to click and hold an IR pen in the other to write with. - If you did this then maybe all you would have to do is cover the wireless mouse Red led with some tape.

Your suggestion of using a wireless mouse by moving it along the surface of the whiteboard would not work because a typical mouse records it's motions relative to where it was - for example you can pick up a mouse and move it to a new location and the cursor does not move.  You would need the wiimote with it's calibration points to track the location in space.


My wiimote should come in sometime next week so I can try this out....

Well i can say it will work, because i can click with my normal mouse and move with my irpen. The only problem is how you get the hardware into your pen, if you use a big pen there's no problem, i use a mini lighter with the normal led replaced by a IR one, so i need some other casing  ::)