Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - noobzor

Pages: 1
1
Hmm, I see I understand now thanks a lot man you've helped me a lot.  :)

2
I think he means to do this:
Code: [Select]
                   Win32.INPUT[] buffer = new Win32.INPUT[2];
                    buffer[0].type = Win32.INPUT_MOUSE;
                    buffer[0].mi.dx = (int) (warpedX * 65535.0f / screenWidth);
                    buffer[0].mi.dy = (int) (warpedY * 65535.0f / screenHeight);
                    buffer[0].mi.mouseData = 0;
                    buffer[0].mi.dwFlags = Win32.MOUSEEVENTF_ABSOLUTE | Win32.MOUSEEVENTF_MOVE;
                    buffer[0].mi.time = 0;
                    buffer[0].mi.dwExtraInfo = (IntPtr) 0;

                    buffer[1].type = Win32.INPUT_MOUSE;
                    buffer[1].mi.dx = 0;
                    buffer[1].mi.dy = 0;
                    buffer[1].mi.mouseData = 0;
                    buffer[1].mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
                    buffer[1].mi.time = 1;
                    buffer[1].mi.dwExtraInfo = (IntPtr) 0;

                    buffer[2].type = Win32.INPUT_MOUSE;
                    buffer[2].mi.dx = 0;
                    buffer[2].mi.dy = 0;
                    buffer[2].mi.mouseData = 0;
                    buffer[2].mi.dwFlags = MOUSEEVENTF_LEFTUP;
                    buffer[2].mi.time = 1;
                    buffer[2].mi.dwExtraInfo = (IntPtr) 0;

                    buffer[3].type = Win32.INPUT_MOUSE;
                    buffer[3].mi.dx = 0;
                    buffer[3].mi.dy = 0;
                    buffer[3].mi.mouseData = 0;
                    buffer[3].mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
                    buffer[3].mi.time = 1;
                    buffer[3].mi.dwExtraInfo = (IntPtr) 0;

                    buffer[4].type = Win32.INPUT_MOUSE;
                    buffer[4].mi.dx = 0;
                    buffer[4].mi.dy = 0;
                    buffer[4].mi.mouseData = 0;
                    buffer[4].mi.dwFlags = MOUSEEVENTF_LEFTUP;
                    buffer[4].mi.time = 1;
                    buffer[4].mi.dwExtraInfo = (IntPtr) 0;

                    Win32.SendInput (5, buffer, Marshal.SizeOf (buffer[0]));
Note that on the last line, the number of inputs has changed from 2 to 5.

Hmm it seems it doesn't work for me. I've putted this code before the line of binding the Wii Buttons. Could you put the exact block where I will put this? Btw, why changed the inputs into 5? I've also received an exception Out of Bounds since the code you gave exceeds the size of buffer size.

Yeah!

Thanks GoldenEagle. :)

You can place this code when the user activates the IR point or when the IR point disappears.

However, you will not to differentiate when you want to do a double click or a normal left click.

Regards,
Boon Jin

I've made up another form where the user will click what he want to do whether left click etc..

3
Hi noobzor,

Like I have mentioned, you just need to repeat the code for a single left click for a double left click.
Make sure the size of the input buffer is correct.

The easiest way to do it is just copy the whole block of code and paste it right below it. That's all to it.

I think you are facing a dead end because you have placed the mouse up twice instead.
You will need to have the mouse down, up as a single left click. Then, down and up again for the double click.


Regards,
Boon Jin

Hmm, what block in particular? Is it the whole OnWiimoteChanged event? I've tried that to nothing works. I've tried everything man nothing really works. I can't seem to know what exact block to repeat. Could you help me out here? What do you mean Input Buffer Size? Does it matter? I've found several examples all are on the same size but still none of their methods work for me.

Thanks.

4
Hmm, the IWB did not use mouse_event method instead SendInput. I've tried everything nothing worked. I just need to know the specific block that I will repeat to as Boonjin said to me. hmm..

Code: [Select]
   if (!lastWiiState.IRState.Found1)//mouse down
                {
                    //lastWiiState.IRState.Found1 = ws.IRState.Found1;
                    smoothingBufferIndex = 0;//resets the count
                                     
                    Win32.INPUT[] buffer = new Win32.INPUT[2];
                    buffer[0].type = Win32.INPUT_MOUSE;
                    buffer[0].mi.dx = (int) (warpedX * 65535.0f / screenWidth);
                    buffer[0].mi.dy = (int) (warpedY * 65535.0f / screenHeight);
                    buffer[0].mi.mouseData = 0;
                    buffer[0].mi.dwFlags = Win32.MOUSEEVENTF_ABSOLUTE | Win32.MOUSEEVENTF_MOVE;
                    buffer[0].mi.time = 0;
                    buffer[0].mi.dwExtraInfo = (IntPtr) 0;

                    buffer[1].type = Win32.INPUT_MOUSE;
                    buffer[1].mi.dx = 0;
                    buffer[1].mi.dy = 0;
                    buffer[1].mi.mouseData = 0;             
                    buffer[1].mi.dwFlags = MOUSEEVENTF_LEFTDOWN;
                    buffer[1].mi.time = 1;
                    buffer[1].mi.dwExtraInfo = (IntPtr) 0;                 

                    Win32.SendInput (2, buffer, Marshal.SizeOf (buffer[0]));

                                               

                    switch (calibrationState)
                    {
                        case 1:
                            srcX[calibrationState - 1] = x;
                            srcY[calibrationState - 1] = y;
                            calibrationState = 2;
                            doCalibration ();
                            break;
                        case 2:
                            srcX[calibrationState - 1] = x;
                            srcY[calibrationState - 1] = y;
                            calibrationState = 3;
                            doCalibration ();
                            break;
                        case 3:
                            srcX[calibrationState - 1] = x;
                            srcY[calibrationState - 1] = y;
                            calibrationState = 4;
                            doCalibration ();
                            break;
                        case 4:
                            srcX[calibrationState - 1] = x;
                            srcY[calibrationState - 1] = y;
                            calibrationState = 5;
                            doCalibration ();
                            break;
                        default:
                            break;
                    }
                    // }//calibtation state
                }//mouse down               
                else
                {
                    Win32.INPUT[] buffer = new Win32.INPUT[1];
                    buffer[0].type = Win32.INPUT_MOUSE;
                    if (enableSmoothing)
                    {
                        System.Drawing.PointF s = getSmoothedCursor (smoothingAmount);
                        buffer[0].mi.dx = (int) (s.X * 65535.0f / screenWidth);
                        buffer[0].mi.dy = (int) (s.Y * 65535.0f / screenHeight);
                    }
                    else
                    {
                        buffer[0].mi.dx = (int) (warpedX * 65535.0f / screenWidth);
                        buffer[0].mi.dy = (int) (warpedY * 65535.0f / screenHeight);
                    }
                    buffer[0].mi.mouseData = 0;
                    buffer[0].mi.dwFlags = Win32.MOUSEEVENTF_ABSOLUTE | Win32.MOUSEEVENTF_MOVE;
                    buffer[0].mi.time = 0;
                    buffer[0].mi.dwExtraInfo = (IntPtr) 0;

                    Win32.SendInput (1, buffer, Marshal.SizeOf (buffer[0]));
                }
            }//ir visible
            else
            {
                if (lastWiiState.IRState.Found1)//mouse up
                {
                    //lastWiiState.IRState.Found1 = ws.IRState.Found1;
                    //Console.WriteLine ("aw");
                    Win32.INPUT[] buffer = new Win32.INPUT[2];
                    buffer[0].type = Win32.INPUT_MOUSE;
                    buffer[0].mi.dx = 0;
                    buffer[0].mi.dy = 0;
                    buffer[0].mi.mouseData = 0;
                   
                    buffer[0].mi.dwFlags = MOUSEEVENTF_LEFTUP;
                    buffer[0].mi.time = 0;
                    buffer[0].mi.dwExtraInfo = (IntPtr) 0;

                    buffer[1].type = Win32.INPUT_MOUSE;
                    buffer[1].mi.dx = 0;
                    buffer[1].mi.dy = 0;
                    buffer[1].mi.mouseData = 0;
                    buffer[1].mi.dwFlags = Win32.MOUSEEVENTF_MOVE;
                    buffer[1].mi.time = 0;
                    buffer[1].mi.dwExtraInfo = (IntPtr) 0;                 

                    Win32.SendInput (2, buffer, Marshal.SizeOf (buffer[0]));                   
                    ;
                }//ir lost           
            }

i've tried repeating that codes still i found no success.

5
Hi,


Yes I've tried also that Thread Sleep somehow I didn't still get what I want. Hmm, wonder How could I simulate Double Click Properply. Boonjin told me repeat a block of codes but I don't what exact block to repeat.

Thanks.

6
Hi,

In my project I want to implement a double click function. I've successfully implemented all Clicks except for this one. Boonjin told me that I should repeat the lines where the clicks goes. I've already tried that but nothing happens. What particular code to allow me simulate a double click I'm using C#.

Also, I wanted to know if there is a way to automatically recognize the Wiimote as HID everytime the PC reboots. Since when the PC is rebooted, Wiimote connection as HID is gone, I wanted that every time PC is rebooted Wiimote will automatically recognized since Wiimote will be bound on a wall and there is no way to reach buttons (1,2) is there a way to achieve that?


Thanks

7
General Discussion / wiimote lib on vista 64bit
« on: March 28, 2009, 08:39:42 AM »
hey guys,

ok i've tested this library using windows xp 32 bit then i switched my other pc running on vista 64-bit sp1 then test this again. the connection and program is working fine but then i cannot control the cursor even though i checked the cursor control checkbox. I've read the documentation and find out that it has some bugs running on 64-bit, is it that bug? or was it fix and unusual thing that happened to me

TIA guys

8
IR Pens / Re: ir led and ir pen
« on: February 08, 2009, 04:32:02 AM »
i don't have its data sheet but the seller brouhgt it up when i bought the diode on the shop. As i've mentioned above they have the same specs with TSAL6400 but differs in angles.

my diode has a 1.7V forward voltage, 940nM and 100mA and 75 degrees angle.

9
IR Pens / ir led and ir pen
« on: February 07, 2009, 08:08:30 AM »
ok so i build my first ir pen. i did this using an Infrared Diode. The diode has the same spec of the Vishay TSAL6400 but they differ in the angle of instenity(correct me if i'm wrong).

mine was 75 degrees and the TSAL6400 is 25 degrees.

tried Lee's project and Boojin's board all went fine but for my calibration. i can't seem perfect the calibration.

I've reached 55% tracking utilization still tracking was not efficient as on the video. What do you think is the problem? Is it my LED or do I have to increase my tracking utilization?

one thing, the shape of my diode is not the ordinary diode you can buy on radioshack. Its tip is not round as TSAL6400 does but instead it is a semi-square shape.


TIA

Pages: 1