SetAccelerator works but types key

I am using the setAccelerator for a JMenuItem and it is working fine but what I am noticing is that if the focus is on a JTextField or a control which receives it will type the key of the accelerator for example:
jmiMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, Event.ALT_MASK, false));
is the declaration of the Accelerator which works fine but when I use the ALT-A it will type an 'a' in the field which has focus.. HELP please.

try this:
jmiMenuItem.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, Event.ALT_MASK, true));
this will based the accelerator on a key release rather than key press. If this doesn't work and you use processKeyBinding, I would put a trap there to consume the event. Finally, if all else failed, check the bug database -- there have been reports of the accelerator not properly consuming the key event.
V.V.

Similar Messages

  • I have set up sync and it has worked, but the key is impossibly long and I can't memorize it. I would have to write it down and then what, store it in my iphone case for use away from the computer? That's no good.

    Can I change the sync key sequence to something I can remember I guess is my question.

    No, Mozilla doesn't allow the user to create their own Sync Key any longer, it is a standardized 26 character string that us generated automatically. There is a shorter 15 character string that seems to be used for mobile devices and used when setting a different device once Sync is set up and the initial sync is completed, but I don't know how the two different strings relate to each other.
    Once FirefoxHome is setup in the iPhone it should remember the login information and work seamlessly. You shouldn't have to remember your Sync Key and fill it out after the initial setup of the FirefoxHome app.

  • While using Illustrator or Photoshop I seem to be hitting a shortcut to lock my key board. Other shortcuts work but can not type anything?

    While using Illustrator or Photoshop I seem to be hitting a shortcut to lock my key board. Other shortcuts work but can not type anything?

    You are planning to do a number of things, so let me first make a suggestion about the overall approach. Instead of: "Before I make a clone of my hard drive I would like to fix this problem so I only have one account with everything in it but I do not know what to move ... or how to safely move it", I would make that clone immediately. And leave it alone until you have completed the reconfiguring and rearrangements you plan to do. This way, if you accidentally do something that needs to be undone, your clone is there with all the originals. By the way, this is the approach I always adopt, whenever I have to do anything drastic with an existing installation.
    After all the rearranging etc. of the main drive you just make a new clone that erases the previous one.
    The "Deano" account doesn't show up when I go to System Preferences:Accounts. So I assume I must have done something wrong.
    This would suggest to me there is only one account, i.e. the principal, or Admin account. Why do you think there is a second account?
    Where should I keep all my work files?
    You can keep them where ever it is most convenient. As you know, you can create folders within folders, and there is nothing special about the Documents folder. Feel free to ignore it, if that's the way you want to work. You can direct your downloads, the default "save to" locations etc. to the appropriate places, as you work.
    Can I create a new place for all my work files and just move them? I know I will have to update linked files within the various software packages but this is not a problem.
    By all means.
    .. can it be directly on the HD like my Applications folder etc.?
    Indeed, yes. Or even on a different hard drive (or partition of the same drive).
    And best wishes for the new year, to you too.

  • New keepassx (0.4.0-1) global auto-type key not working with Win-key?

    After system upgrade in new version of keepassx (0.4.0-1) stop working global auto-type key set previously to Win+K stop working. I tried to set it once more  (menu Edit->Settings->Advanced) but combinations with Win key are not recognised anymore. I am just curious if anybody have same problem. Anyway, I happily downgraded back to keepassx 0.3.4-1 .

    I found it at http://archlinux.alouche.net, got there from Downgrade packages. Direct links: i686, amd64.

  • I have an ancient laptop (from 2005) that has my entire music library. This laptop barely works and some keys don't type anymore. How can I get all this music transferred to another computer, or available to me on the cloud?

    I have an ancient laptop (from 2005) that has my entire music library. This laptop barely works and some keys don't type anymore. How can I get all this music transferred to another computer, or available to me on the cloud?

    No... do not move programs.
    About the iTunes library files
    Your iTunes library files track the media you add to iTunes, how you've organized it, and other information such as playlists. By default, these two files are in your iTunes folder:
    Mac OS X: /Users/username/Music/iTunes/
    Windows XP: C:\Documents and Settings\username\My Documents\My Music\iTunes\
    Windows Vista: C:\Users\username\Music\iTunes\
    Windows 7: C:\Users\username\My Music\iTunes\
    Windows 8: C:\Users\username\My Music\iTunes\

  • Wireless keyboard right shift don't work with some keys but left shift works

    So, this is really a strange behaviour under Mavericks 10.9.5
    My right shift doesn't like some "keys" and some keys don't like the shifts ( either left or right ). For example:
    doing a " ? " or a " B " or a " % " with the right shift doesn't work. I mean, after i remove the batteries and stay without using the keyboard for a day or two, when i get back to it, it works for a couple of minutes. But after that... i just can do a capital B or a ? with the right ****. Although i can do all other characters.
    the " t " key is another one. No caps here, with either left or right shift key. But the key by itself is working just fine.
    So i'm not really 100% convinced it's an hardware fault, because the all keys are working properly in other situations.
    Any idea about this strange behaviour?
    thank you for your time,
    Regards
    Pedro.

    Hello Postmodum,
    Check out the article below and turn on the keyboard viewer to see what happens to the keyboard when you press the right shift key. You may find out that it may be linked to add another combination of keys, which can produce the odd behavior that you are describing. 
    One or more keys on the keyboard do not respond
    http://support.apple.com/kb/TS1381
    Regards,
    -Norm G. 

  • My apple wireless keyboard got wet a year ago i sprayed the cleaning spray on it some of the keys are working but some of the keys aren"t working. it got sprayed a year ago What should i do??? Can it be recovered plz tell?

    I sprayed it a year ago i really like the keyboard and i really need it can it be recovered??? My apple wireless keyboard got wet a year ago i sprayed the cleaning spray on it some of the keys are working but some of the keys aren"t working. it got sprayed a year ago What should i do??? Can it be recovered plz tell?

    There is almost no chance it can be recovered, except at a cost far greater than a new keyboard.  Once wet, spraying with a cleaner will not do any good and most likely will make the situation worse.
    Best thing at this point is go to your Apple store, or the on-line store, and buy a new keyboard.  Water damage is not covered by the warranty or AppleCare.

  • Installed Windows 8 on a late 2011 MacBook Air and was working fine now keyboard not working so cannot enter password? Caplocks key works but I am locked out on my own PC and cannot seem to get it to recognize built in keyboard,bluetooth,generic USB one.

    Installed Windows 8 on a late 2011 MacBook Air and was working fine now keyboard not working so cannot enter password? Caplocks key works but I am locked out on my own PC and cannot seem to get it to recognize built in keyboard,bluetooth,generic USB one.

    Use the trackpad to scroll, thats what it was designed for. The scroll bars automatically disappear when not being used and will appear if you scroll up or down using the trackpad.
    This is a user-to-user forum and most people will post on here if they have problems. You very rarely get people posting to say there update went smooth. The fact is the vast majority of Mountain Lion users will not be experiencing any major problems with the OS, or maybe with apps which are not compatible, but thats hardly Apple's fault if developers don't update their apps.

  • I am running Mac OS X Lion on a brand new Mini.  Every now and then, my keyboard goes "dead."  The mouse still works but can't type.  If I restart, everything is fine again.  Is there anything that will fix this problem?

    I am running Mac OS X Lion on a brand new Mini.  Every now and then, my keyboard goes "dead."  The mouse still works but I can't type.  If I restart, everything is fine again.  Is there anything that will fix this problem?
    Also, I am trying to connect my Mini from the mini-Displayport to the Displayport of my Dell U2410 monitor.  The image is very grainy,even though it is set to the correct resolution: 1920 X 1200 at 60Hz.  If I use HDMI to VGA input, the image is much clearer.  Is there a way to get the Displayport to work?

    I'm having exactly the same keyboard issue.  Certainly nothing has ever enhanced my concentration while coding like suddenly becoming unable to type.
    I'm seeing a great many devicemgr and rake errors in my system log.  I don't know if they're related.  How 'bout you?
    If you're unfamiliar with the system log…
    Open /Applications/Utilities/Console.
    If necessary, choose View > Show Log List.
    system.log is at the top of the FILES section.
    Try searching it for hot words like DEBUG, FATAL, and aborted.
    I've found some discussions that would tend to indicate my errors are postGres related – I'm running OS X server.
    -Bryan

  • My Wireless mac keypad has stopped properly working. The keys sometime do not correspond to the result, or a a simultaneous duel actio, for example when the delete button is pressed the. Ursor does go backwards, but it also turns the sound up. Any ideas?

    My Wireless mac keypad has stopped properly working. The keys sometime do not correspond to the result, or a a simultaneous duel actio, for example when the delete button is pressed the. Ursor does go backwards, but it also turns the sound up. The keyboard is properly connected to the computer, and the battery life is up in the nineties.
    Help please !!!!

    Hi, thankyou for your response. Can I just confirm that you mean turning the computer on and off again, or re-booting the whole system. If it is the first I have already turned the system on and off, with no luck.
    Regards

  • What are the control functions of Suitability and setup type key in work center?

    Hi all,
    Can any1 plz tell me what is suitability and setup type key in workcenter default values tab?
    what are the functions controlled by these keys?

    Hello,
    Control Key in Defaut value keys screen is mainly for defining how the work center will be used in routings.
    Almost in all the PP we define same Control key to the work center as well in the routing.
    For example in work center control Key PP01 is used to define Routings/Internal proc. activities. When we go to the routing screen even if we do not see our components, work centers or control key we have to manually enter these details ans here control Key will remain the same as it was in Work center.
    No. of individual capacity defines how many machines are there of the same type in the work center. E.g if I have 5 CNC machines then I will make One work center and in capacity screen I will put 5 as No. of individual Capacity.
    Regards,
    Piyush

  • My zagg key board connects but the keys I type either don't type character, type 2 characters that are different when I hit only 1 key, or doesn't type at all. Is there a way to reset zagg keyboard to factory settings?

    My zagg key board connects but the keys I type either don't type character, type 2 characters that are different when I hit only 1 key, or doesn't type at all. Is there a way to reset zagg keyboard to factory settings?

    Recharging is a good thing to try. They do start to act odd when the battery gets low. Beyond that, just like Tom says, contact Zagg. I have one of their keyboards and the company has wonderful customer service.

  • G4 just replaced power supply , it powers up , but the screen is not on and the mouse and keyboard aren't on either. A few times the computer came on with screen working but then it froze up, can't do any type of reset cause of keyboard not working. Help!

    G4 just replaced power supply , it powers up , but the screen is not on and the mouse and keyboard aren't on either. A few times the computer came on with screen working but then it froze up, can't do any type of reset cause of keyboard not working. Help! Pressed pmu button already,  nothing ,..  Ppc g4 Mac

    Should I check the memory cards themselves? Reseat them?
    Yes.
    Memtest X or Rember to test the RAM.
    Reseat is also good.
    The iPhone 4 doesn't like USB 1.1 much.
    after the update the computer was working well, except for this freeze when ever I connect iPhone.
    I'd try USB 2.0 PCI. That's how I connect my iPhone 4s, and have connected all iPhones and iPods, to my G4.
    Never an issue.
    Can't say the same for USB 1.1.......
    The above (previous post) linked PCI card is cheap enough.
    Want cheaper, try this:
    http://www.amazon.com/Protronix®-5-Port-Controller-Card-Chipset/dp/B005JE2U82/re f=sr_1_2?ie=UTF8&qid=1337472141&sr=8-2
    The NEC chipset is the desired chipset, regardless of what OS the maker says is compatible.
    OS X has native NEC chipset USB support.

  • I want to save passwords in firefox (that's ok, I know how it works), BUT i don't want to fill automaticly when I type my username on a site.

    I want to save passwords in firefox (that's ok, I know how it works), BUT i don't want to fill automaticly when I type my username on a site.

    Dear Icom
    plese try to update your Firefox Client the latest version.

  • I did an auto software update on my iMac, which included a restart. When the machine restarted it's stuck with an Apple logo and spinning wheel. I've tried all of the key strokes that are supposed to work, but nothing has. Any suggestions? Thanks!

    I did an auto software update on my iMac, which included a restart. When the machine restarted it's stuck with an Apple logo and spinning wheel. I've tried all of the key strokes that are supposed to work, but nothing has. Any suggestions?

    Gray screen could be any number of things, bad third party at boot kext file, a bad Apple one, a bad install/upgrade of OS X, drive corruption etc.
    Run through this list of fixes
    Step by Step to fix your Mac

Maybe you are looking for