Go Down

Topic: USB Absolute Mouse Mode (Read 8 times) previous topic - next topic

ChuckJaxFL

I was able to get the cursor to stop moving to 0,0 upon Mouse.click();
In the HIP.CPP, I found

Code: [Select]

void Mouse_::click(uint8_t b)
{
_buttons = b;
  move(0,0,0);
_buttons = 0;
  move(0,0,0);
}

and changed it to
Code: [Select]
void Mouse_::click(uint8_t b)
{
_buttons = b;
// move(0,0,0);
_buttons = 0;
// move(0,0,0);
}


However, I am still not getting a click in absolute mode.  Any ideas?

slechtvalk

#6
Dec 19, 2012, 05:35 pm Last Edit: Dec 19, 2012, 06:12 pm by slechtvalk Reason: 1
i try to use it for a pro micro 5V from SparkFun but it wont work. Arduino gives me this error

D:\Dropbox\arduino-1.0.3\hardware\SF32u4_boards\cores\arduino\HID.cpp: In constructor 'Keyboard_::Keyboard_()':
D:\Dropbox\arduino-1.0.3\hardware\SF32u4_boards\cores\arduino\HID.cpp:267: error: class 'Keyboard_' does not have any field named '_keyMap'
D:\Dropbox\arduino-1.0.3\hardware\SF32u4_boards\cores\arduino\HID.cpp: At global scope:
D:\Dropbox\arduino-1.0.3\hardware\SF32u4_boards\cores\arduino\HID.cpp:276: error: variable or field 'setKeyMap' declared void
D:\Dropbox\arduino-1.0.3\hardware\SF32u4_boards\cores\arduino\HID.cpp:276: error: 'KeyMap' was not declared in this scope
D:\Dropbox\arduino-1.0.3\hardware\SF32u4_boards\cores\arduino\HID.cpp:276: error: 'keyMap' was not declared in this scope
D:\Dropbox\arduino-1.0.3\hardware\SF32u4_boards\cores\arduino\HID.cpp: In member function 'virtual size_t Keyboard_::write(uint8_t)':
D:\Dropbox\arduino-1.0.3\hardware\SF32u4_boards\cores\arduino\HID.cpp:424: error: '_keyMap' was not declared in this scope
D:\Dropbox\arduino-1.0.3\hardware\SF32u4_boards\cores\arduino\HID.cpp:439: error: 'KEY_MODIFIER_LEFT_SHIFT' was not declared in this scope


edit : same problem at 1.0

edit 2  : now it works with a disabled keyboard function. I still hope for solution so i can also use the keyboard.  When i move the mouse to (100,100) . I don't go to pixel 100,100 but somewhere in the right corner of my screen. Can i use the function that the 100 mean the pixel size?

arvind_gowda

would you help me how to increase the resolution above mouse.move(100,100); because am using an wide screen laptop it may require mouse.move(120.120);

Carlos mononoke

Hi alls!!

Thanks for your work, it is awesome.

I am trying to move the mouse pointer in one 17´´ Laptop display.
it works but not fit all the display,if the diagonal line is drawed by (1,1) to (100,100) y should need (1,1) to (120,120)

i have triyed change HID.cpp logical_maximun from 0x64 to 0x78 but it didn´t work

Code: [Select]
#ifdef ABSOLUTE_MOUSE_MODE
    0x15, 0x01,                    //     LOGICAL_MINIMUM (1)       <<<< This allows us to talk to any display resolution
    0x25, 0x78,                    //     LOGICAL_MAXIMUM (120)     <<<<  as though it was 100x100 pixels
    0x75, 0x08,                    //     REPORT_SIZE (8)
    0x95, 0x03,                    //     REPORT_COUNT (3)
    0x81, 0x02,                    //     INPUT (Data,Var,Abs)      <<<< This allows us to moveTo absolute positions
#else


and i have tryed change usbcore.cpp device descriptor(...,64,.....) to 78 too,.but it didn´t work
i think it was packetsize variable and maybe.... but not.
Code: [Select]

DEVICE DESCRIPTOR
const DeviceDescriptor USB_DeviceDescriptor =
D_DEVICE(0x00,0x00,0x00,64,USB_VID,USB_PID,0x100,IMANUFACTURER,IPRODUCT,0,1);

const DeviceDescriptor USB_DeviceDescriptorA =
D_DEVICE(DEVICE_CLASS,0x00,0x00,64,USB_VID,USB_PID,0x100,IMANUFACTURER,IPRODUCT,0,1);



Sincerely i have no much idea about what i am doing...
i supose tath somewhere there is a variable that say how many distance can move ore some thing but i have no idea about where can i find it.


someone can help me

Thanks!!!!

eco_bach

This is great, however, mapping to 100 pixels gives a VERY staccato effect to the mouse movement.

What values would you change in the HID file to map to any resolution?

Go Up