• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Left mouse can not generate mouse clikced and released events??

 
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
We have vertical and horizontal AWT scroll bars in out applet. We are trying to capture the mouse clicked and released events on that component. But the component generates only pressed, entered and exited events. But the right mouse button generates clicked and released events (weird!!). Is there any way to fix this sothat the left mouse button generates the clicked and released events?
Any help would be appreciated.
Thanks
Rajesh Purohit
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
They should both be generating events. They just have different masks to identify them
From the API:


When multiple mouse buttons are pressed, each press, release, and click results in a separate event. The button mask in the
modifier field reflects only the button that changed state, not the current state of all buttons.
For example, if the user presses button 1 followed by button 2 and releases them in the same order, the following sequence of
events is generated:
MOUSE_PRESSED: BUTTON1_MASK
MOUSE_PRESSED: BUTTON2_MASK
MOUSE_RELEASED: BUTTON1_MASK
MOUSE_CLICKED: BUTTON1_MASK
MOUSE_RELEASED: BUTTON2_MASK
MOUSE_CLICKED: BUTTON2_MASK

If button2 is released first, the MOUSE_RELEASED/MOUSE_CLICKED pair for BUTTON2_MASK arrives first, followed
by the pair for BUTTON1_MASK.

 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Note that Java doesn't refer to "left" or "right" because these things are user-configurable on many systems. Apparently some left-handers find it useful to reverse the functionality of the two buttons; as a left-hander myself I've never found this necessary, but some people do. It sounds like your system has reversed the "normal" functionality between the two keys. On Windows 98 at least, you can control this by going to Start -> Settings -> Control Panel -> Mouse -> Button Configuration. On other Windows systems it's probably similar; I'm sure it's also possible on a real operating system , but you'll have to consult your documentation.
 
rajesh purohit
Ranch Hand
Posts: 33
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I know the mouse listener and its events ... but i want to handle mouse released event for ScrollBar Object. in java u can not handle mouse released event for scrollbar object. that's the problem .. i can use other listeners but in particular i want to use mouse released event so that the scrolling can only be done when mouse is released at the destination and not simultanously when scroll bar is moving.
thanx for ur time
Rajesh
 
I'm so happy! And I wish to make this tiny ad happy too:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic