Results 1 to 7 of 7
  1. #1
    bassfero is offline Member
    Join Date
    Jul 2010
    Posts
    22
    Rep Power
    0

    Default Multiple-mouse support

    Hi,

    it is possible to have multiple mice in single java application.

    If yes, how I can handle each of them?

  2. #2
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    SW Missouri
    Posts
    17,305
    Rep Power
    25

    Default

    How does the OS handle multiple mice? Do you assign a cursor to each mouse?

  3. #3
    bassfero is offline Member
    Join Date
    Jul 2010
    Posts
    22
    Rep Power
    0

    Default

    Quote Originally Posted by Norm View Post
    How does the OS handle multiple mice? Do you assign a cursor to each mouse?
    Well not me but I know one development kit that can do it (assing a cursor to each mouse), but it's .net not java.

    I've googled for that, I found that Java does not have mouse multipoint support but it was discussion from 2006, so I thought that now this problem is solved.

    By default when you plug 2 or more mice, you can control one cursor with all of them (either Win or Linux).

    I know that it's possible to code it (for example game World of Goo can be runned under linux and support multiple cursors). I want to know how it is possible with java.

    Or it is possible to emulate a mouse with own cursor in JAVA? It would be even better solution for my problem.

  4. #4
    bassfero is offline Member
    Join Date
    Jul 2010
    Posts
    22
    Rep Power
    0

    Default

    Any ideas anybody?

    Can I generate mouse events and emulate a mice this way? I don't need a cursor I just need that other application that react on mouse move react like there were more mices.

  5. #5
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,337
    Blog Entries
    7
    Rep Power
    20

    Default

    Quote Originally Posted by bassfero View Post
    Any ideas anybody?

    Can I generate mouse events and emulate a mice this way? I don't need a cursor I just need that other application that react on mouse move react like there were more mices.
    I don't think it can be done in general; there's one mouse pointer (there's also one text cursor, the 'caret'); it doesn't have any use anyway to support more of them. (think of the problems if you can drag more components simultaneously). Maybe a 'multi gesture' screen can do it.

    kind regards,

    Jos

  6. #6
    bassfero is offline Member
    Join Date
    Jul 2010
    Posts
    22
    Rep Power
    0

    Default

    Quote Originally Posted by JosAH View Post
    I don't think it can be done in general; there's one mouse pointer (there's also one text cursor, the 'caret'); it doesn't have any use anyway to support more of them. (think of the problems if you can drag more components simultaneously). Maybe a 'multi gesture' screen can do it.

    kind regards,

    Jos
    well it can be done, but on linux I saw just two solutions

    1. World of Goo (but it's not opensource, so I have no idea how they did it)
    2. MPX (you can see it here YouTube - MPX demo video , it modificates X server and I dont have idea how I can assign each mouse to java Robot or something like that)

    On windows it's (relative) easy, but it's not java stuff.

    I am currently solving my problem by another way, but if someone can solve this problem it can help me (or somebody else) with apps that realy need multi mice(for example multitouch screen emulators).

  7. #7
    paul pasciak is offline Senior Member
    Join Date
    Jul 2008
    Posts
    125
    Rep Power
    0

    Default I think Java accesses protocols

    If you are requirering a solitary workstation
    to operate two mice (mouses?) at the same
    time, then your answer is that Java absolutely
    cannot do this.

    I have never read of such an oddity, and I am
    certain such a feature would have prominance
    in the field of modern programming.

    Maybe you can get USB interface code that will
    allow you to simulate a second mouse.

    Another possibility is that you can recieve
    a second mouse's input by-way-of another
    computer.

    This would involve hooking up another computer
    to your computer through a LAN cable.
    Your code would then utilizes the system's LAN
    protocols. I think Java can do that, and this
    would be for an Applet, not an Application.
    Last edited by paul pasciak; 09-30-2010 at 07:42 PM.

Similar Threads

  1. Running multiple threads on multiple CPU cores?
    By Dosta in forum Threads and Synchronization
    Replies: 2
    Last Post: 09-19-2010, 03:48 PM
  2. Mouse Listener for mouse floating over object?
    By Krooger in forum AWT / Swing
    Replies: 1
    Last Post: 11-18-2009, 04:34 AM
  3. How to support multiple languages?
    By bhupal4all in forum New To Java
    Replies: 2
    Last Post: 09-05-2008, 09:58 AM
  4. RSS Support?
    By dimitrist in forum Suggestions & Feedback
    Replies: 5
    Last Post: 06-29-2008, 04:45 AM
  5. UTF-8 support in Eclipse
    By mew in forum Eclipse
    Replies: 3
    Last Post: 01-20-2008, 08:28 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •