• 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

Preventing the Windows logo key from activating the Windows Start menu...

 
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
All,

Ok, I'm working with capturing/intercepting keystrokes in Java.

My class extends JPanel, has a key listener, and gets the keyPressed, keyTyped, and keyReleased events. I've managed to get most stuff working so that even international keys (ie: on Japanese keyboards) work right.

I've also, in the constructor, used the following:

this.enableInputMethods(false);
this.setFocusTraversalKeysEnabled(false);

My problem is with the Windows Logo key (which generates keyCode VK_WINDOWS, or 524). I can capture the keystroke, but can't figure out how to prevent the Start menu from opening up.

Anyone have any idea how I can accomplish this? Is it possible? Thanks in advance.
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm pretty sure this is not possible in Java. You might be able to do it using JNI.
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I find that a pen-knife works exceedingly well on the "Windows" key. Pry it off, put it in a drawer. I have quite a few of them.
 
Joe Vahabzadeh
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Torgil Zethson:
I'm pretty sure this is not possible in Java. You might be able to do it using JNI.



Bummer. For the project I'm working on, JNI isn't permitted (the software has to run on any operating system).

Originally posted by Ernest Friedman-Hill:
I find that a pen-knife works exceedingly well on the "Windows" key. Pry it off, put it in a drawer. I have quite a few of them.



You don't know how badly I wish I could do that sometimes!
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Is that really a problem? After all, your application can never be sent that keystroke, can it?
 
Joe Vahabzadeh
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
as a matter of fact, it can. And does.

Our goal, ideally, is that we capture everything and send it along to the remote system. So far, the only problem is the Windows Logo key, which we do capture an send to the remote system, but can't prevent the client system from responding to, if it's a Windows OS.
 
Torgil Zethson
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The best 100% Java solution I can think of is to display a popup message, asking the user not to press the Windows key again...
 
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
! "Stop that you !"

[Edited to be a little less unfriendly]
[ December 23, 2005: Message edited by: David Weitzman ]
 
Joe Vahabzadeh
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
LOL! Don't tempt me.....
 
Ken Blair
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ken Blair:
! "Stop that you !"

[Edited to be a little less unfriendly]

[ December 23, 2005: Message edited by: David Weitzman ]



But it's supposed to be unfriendly! Damn users, who do they think they are using our software! Damn them all!
 
reply
    Bookmark Topic Watch Topic
  • New Topic