Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <blockquote> <ul> <li>Using MouseListener on the buttons instead of ActionListener, then 'consuming' the MouseEvent in the hope that the other application won't register it and hide the context menu.</li> </ul> </blockquote> <p>This doesn't currently work for you because consuming events in Java only effects your application, it cannot prevent the events propagation on the native system. JNativeHook 1.2 may have an undocumented method to allow you to do this on windows, although I am not sure if it will actually solve your problem. If you consume a click event on the native system, the jvm probably wont receive the click event on the osk button to send the arrow down events. There would be no way to detect if the java button is being clicked before you would need to consume the native event. In other words, the NativeInputEvent where you would call a consume method would probably be delivered before the Java AWT InputEvent. Please see <a href="https://code.google.com/p/jnativehook/issues/detail?id=22" rel="nofollow">https://code.google.com/p/jnativehook/issues/detail?id=22</a> for more information.</p> <p>The only good solution I can think of right now would be to use JNA to call Windows API and grab the context menu handle then traverse it directly. There are API's available to do this sort of thing, I just don't remember what they are off the top of my head. Maybe start with <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ff468865(v=vs.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/windows/desktop/ff468865(v=vs.85).aspx</a> and see if you can create a small test program to manipulate the menu.</p> <p><em>*</em> Small Update: After a little more Googling I was able to locate the <a href="http://social.msdn.microsoft.com/Forums/vstudio/en-US/a54fbe2a-ab40-4e78-b15b-42289b585142/trying-to-get-a-handle-to-a-context-menu-in-c" rel="nofollow">following post</a> that pretty much outlines how to do this with C++. Porting this to JNA should be fairly trivial.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload