want help about "configure TEENSY act as usb mouse (working independently) "

Status
Not open for further replies.

charnjit

Active member
want help about "configure TEENSY act as usb mouse (working independently) "

hello sir,
i want configure teensy to send usb mouse messeges into pc independently during use of a usb optical mouse.
for detail please read bellow.......
when two optical mouses are connected to a pc, both control a single pointer. they have not two pointers.


when two mouse are connected using (two mouse software) ,they can have two pointers. but they will not
working independently. i means if we used 1st mouse to open FILE MENU & placed pointer on list apeared from FILE MENU.then if
we will click on anywhere in same software window using 2nd mouse , FILE MENU will be closed.


please give me your advice about written bellow.,,,,,,,,,,,
if teensy is configured to send mouse dragging/ scroll wheel messege on (x,y) position anywhere in same software window
(not on FILE MENU).will FILE MENU list be closed cause of teensy's interfere? ,,,,,,,,or.........can teensy be configured to act without
disturbing in working of usb optical mouse(which is used during use of teensy's input )?
i want to use teensy & usb mouse together in same software.when teensy is working on software
window, then pointer of use mouse should not be move or affected cause of teensy.(teensy & usb mouse) both should
not affect pointer position eachother.
is it possible?
 
As far as I can tell you want to have two mouse cursors on screen, which would be an OS function not something a USB device can control. Some touch screen drivers may allow you 'press' screen features without the mouse being moved but that's driver function.
 
As far as I can tell you want to have two mouse cursors on screen, which would be an OS function not something a USB device can control. Some touch screen drivers may allow you 'press' screen features without the mouse being moved but that's driver function.

Sir , I want , teensy should act as usb mouse dragging , scroll wheel function on given screen position (x,y) when second usb mouse pointer is still placed on another position(x,y) . And second usb mouse pointer should not be moved to teensy's given action position . I don't want to use both device(teensy & usb muose) at same time. Is it possible in pc window7 .?
 
request for help

hello , sir
i need to configure teensy
board to send usb mouse dragging/turning scroll wheel messege to given (x,y) position in software screen. i am sorry i don't know ,how
to write code,,,,,,,,,,,,,,,,please help me,,
am using pc window 7 32 bit,,,,,,,,,,,



please make code to actions written bellow,,,,,,,,,,,,,,
4 buttons are connected to pin 0,1,2,3
pin 0 should move pointer to (512,54) position and turn scroll wheel upward being stayed at (512,54) position.
pin 1 should move pointer to (512,54) position and turn scroll wheel downward being stayed at (512,54) position.
pin 2 should move pointer to (357,36) position and drag it upward 5 pixels.
pin 3 should move pointer to (357,36) position and drag it downward 5 pixels.
my screen size is 1366 x 768

sir,,....... i want to use a usb mouse along with teensy board, then which condition can be applied and true?:

1st condition : teensy will be configured as -----after complete action, mouse pointer can be stayed on position where
action was completed.

2nd condition : teensy will be configured as -----after complete action, mouse pointer can be moved pointer to its
previous (660,440)position.where mouse pointer was before use of teensy

3rd condition: teensy will be configured as -----after complete action, mouse pointer can be stayed on its previous
(660,440)position.where mouse pointer was before use of teensy.
please tell which condition can be applied with above 4 actions...
1st =good, 2nd=better, 3rd =best ,
please write code according to above statement.,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,thank you.......
 
Last edited:
Using Teensy as a mouse is at
https://www.pjrc.com/teensy/td_mouse.html
And in the file->examples->teensy-USBMouse example directory.

Working with that code would get you close to your condition 3.

None of this will magically make your operating system have two mice though, or even be able to put the mouse back where it found it after doing it's click thing since Teensy can't ask the OS where it is before it starts moving. To do that you need to look on the PC side at things like macro software or touch screen. In fact quite possibly whatever you are trying to do would be more easily done with macros.
 
How about using 1 mouse and 1 touchscreen as a substitute for the 2nd mouse? Maybe the operating system software would better support that way?

Teensy has (still fairly new & experimental) USB touchscreen support...
 
How many times teensy can be programmed? Please write a simple code example to get : Pin 0 press push button = move mouse pointer to (444,444) , click and drag it to (444,550) ,then move to (547,333) automatically ,,,,,,,,,,, Pin 1 press push button= move mouse pointer to (467,523). ,double click here and move to 554,550 automatically , My screen is 1366* 768
 
@charnjit, I think that nobody here will write your code for you, at least as long as you are not offering $80/h. What GremlinWrangler did, was pointing you towards the USBmouse function reference which will allow you to learn how to write that code by yourself. Additional help can be found in the numerous code examples which come with the Teensyduino plugin for the Arduino IDE.
 
sir ,,,, am going to use my laptop as music rhythm machine for live . this teensy project will be a controlling part of rhythm mchine


ok ., i tried a example , but i get this problem
jj.jpg

please write step-by step procedure of "uploading sketch into teensy" simply & succesfully
 
Last edited:
Did you follow the instructions up on pjrc? https://www.pjrc.com/teensy/td_usage.html

In particular if this is a brand new Teensy that you have never programmed, then you first compile the program using the verify command, and then when the Teensy app shows up, you then press the program button on the Teensy that should upload your program.

If you choose a USB type that includes Serial, then subsequent builds you can simply upload using the upload command.
 
Looks like you have everything set up. If it's not uploading automatically, the upload should start when you press the button on your Teensy.

The 2 most common problem that prevent uploading (but the LED blinks) are charge-only cell phone cables and Chinese counterfeit boards (usually from Ebay or Aliexpress merchants).
 
Ask about Rotary encoder,,,

hello sir ,, i have made usb mouse & keyboard device from teensy using these codes
Code:
[code]
#include <Bounce.h>

Bounce tempoup = Bounce(0, 10);
Bounce tempodown = Bounce(1, 10);
Bounce pitchup = Bounce(2, 10);
Bounce pitchdown = Bounce(3, 10);
Bounce keytap = Bounce(4, 10);
Bounce leytap = Bounce(5, 10);


void setup() {
  Mouse.screenSize(1366, 768);  // configure screen size
  pinMode(0, INPUT_PULLUP);
  pinMode(1, INPUT_PULLUP);
  pinMode(2, INPUT_PULLUP);
  pinMode(3, INPUT_PULLUP);
  pinMode(4, INPUT_PULLUP);
  pinMode(5, INPUT_PULLUP);
}

void loop() {
  tempoup.update();
  tempodown.update();
  pitchup.update();
  pitchdown.update();
  keytap.update();
  leytap.update();
  if (tempoup.fallingEdge()) {
    Mouse.moveTo(512, 54);       // point to pixel at 512, 54
    Mouse.scroll(+1);           // turn scroll wheel upward 1 step
    Mouse.moveTo(345, 94);      
  }
  if (tempodown.fallingEdge()) {
    Mouse.moveTo(512, 54);      // point to pixel at 512, 54
    Mouse.scroll(-1);           // turn scroll wheel downward 1 step
    Mouse.moveTo(345, 94);
  }
  if (pitchup.fallingEdge()) {
    Mouse.moveTo(357, 36);      // point to pixel at (357, 36)
    Mouse.set_buttons(1, 0, 0);  // hold left button
    Mouse.moveTo(357, 31);
    Mouse.set_buttons(0, 0, 0);  // hold left button
  }
  if (pitchdown.fallingEdge()) {
    Mouse.moveTo(357, 36);      // point to pixel at (357, 36)
    Mouse.set_buttons(1, 0, 0);  // hold left button
    Mouse.moveTo(357, 41);
    Mouse.set_buttons(0, 0, 0);  // hold left button
    }
    if (keytap.fallingEdge()) {
    Keyboard.set_key1(KEY_F6);
    Keyboard.send_now();
    Keyboard.set_key1(0);
    Keyboard.send_now();
    }
  if (leytap.fallingEdge()) {
    Keyboard.set_modifier(MODIFIERKEY_CTRL);
    Keyboard.send_now();
    Keyboard.set_key1(KEY_F5);
    Keyboard.send_now(); 
    Keyboard.set_modifier(0);
    Keyboard.set_key1(0);
    Keyboard.send_now();
    }
  
  }
[/CODE]

device is working very fine according to me.

i want to use a rotary encoder along with buttons connected to pin 0 and pin 1 . i saw that ,when rotary encoder is moving clockwise or anti-clockwise ,then middle leg is connected to both outer legs . what should i do . I don't want to replace . i want to keep both switchs & Rotary encoder for Pin 0 and Pin 1.
tell me detailed about circuit & code if needed.
 
Troubleshooting in teensy LC board

Troubleshooting in teensy. I made a usb controller using teensy. It is working very well but sometime it is working automatically instead of push buttons inputs. It is giving unwanted result. What can be reason in it????? Can there be any mistake during uploading sketch. Sometime it is working very well from push buttons . Why it is working automatically sometime ????? Please help me in this problem,,,,
 
Last edited:
Status
Not open for further replies.
Back
Top