-
• #2
it works like that
E.sendUSBHID([0&7,0,0,sens]);
where sens is equal 1 or -1 for scrollup or down
-
• #3
How to get mouse position (coords x,y) and not mouse mouvement?
how to use a mouse mouvement in a webpage when mouse is down to the screen?regards
-
• #4
Thanks for posting up how to send the scrollup/down - that's great.
You're asking how to send Absolute Position? Much like a tablet/touchscreen?
I think what you need is USBTablet: http://www.espruino.com/USB#tablet
However I don't think that supports a wheel by default! To get that you'll have to make your own HID report descriptor by mashing the wheel's descriptor into the tablet bit...
https://github.com/espruino/EspruinoDocs/blob/master/modules/USBMouse.js#L38
https://github.com/espruino/EspruinoDocs/blob/master/modules/USBTablet.js#L40But at that point my knowledge is at an end - you'll have to consult Google and use some trial and error to figure out what will work.
-
• #6
i tested chrome app with Serial connection...
the example to connect an espruino in the google github doesn't work !
....
The console.log output (or print()) is huggly to parse in a browser and lot of frame (1/3) are lost even in 9600baud...
is there a better way to "print" to the serial port? (for sure there is but i'm a stupid graphic designer with too few knowledge in code) ;)thanks for your help
regards
ps: i'm looking for a "simple way" to introduce "tangible interface" (input from real world) for graphic design's students (with html5 and js bases NO Processing.org)... i'm testing chrome-app ... it's not the best way but the "easiest". (for my pov to combine : cheap hardware +html5/css/js (webtech) + newb.
ok, i have to coming out: "i love espruino for learning only one langage to code Hardware and Web..."
i have a lot of arduino compatible board but... i do not like the langage... therefore they take dust... -
• #7
Honestly I'm not sure about the USBTablet stuff - it may be it wasn't recognised by your PC?
Wow, first I've come across that 'connect to espruino' example. I can't get it to work either - but to be honest those hosted Chrome apps are being removed by Google soon anyway.
How about trying this: https://github.com/espruino/EspruinoWebTools#uartjs
It should be just what you want - it'll work off any HTTPS page as long as you view in an up to date Chrome web browser. Right now you have to enable it in chrome://flags (https://codelabs.developers.google.com/codelabs/web-serial/#2) but in a few months that won't be needed.
You can use the Web Serial API directly, but the uart.js wrapper should provide a nice interface around it.
Hello i'm trying to simulate a mouse with a HC-sr04.
it works well with the x,y coord for the mouse from the example
in the report descriptor from here, there is line for x, y and mouseScroll 0x038
description commented found on sparkfun's forum
How to send a mousescroll ? and which value should i send?
best regards
é.