ControlKey - CharaterKey  Combination doesnt work

I am working on a simple text editor project.I need to map keys to some functions.I have tested some key combinations and a lot of them worked just fine.Problem arises when i try to combine the control and the character keys.I performed other key combinations(Shift-Character;Alt-Character)and worked just fine.But the Control-Character key combination fails to work.For the Shift-Character combination it generates the VK codes i wanted,and also for Alt-Character combination.But for Control-Character combinations it generates an empty space(or a null/box-like )character.I expect the same operation by all Modifier-Character mappings.Control gave an exception
I thought this was due to my platform(Windows)but i have tested it on a linux platform as well with the same experience.Any one interested in this.This is my handling module;
addKeyListener( new windowAdapter(){
public void keyTyped(KeyEvent e){
if (e.isControlDown() && e.getKeyChar == 'char')
doWhatIWant();
Note;I have tested the same keyTyped method with the line;
if (e.isShiftDown() && e.getKeyChar =='char'),and gave desired result,and also for Alt.thanks

Hi,
The problem is that you're listening for keyTyped events and looking at the character returned by getKeyChar. It appears that pressing control and the characters your looking for actually produce another Unicode character. keyTyped is typically to be used to listen for character input. What you should be doing instead is listening for keyPressed events. There, you should be checking the return value of getKeyCode. So, for example, say you wanted to check for control-A:
public void keyPressed(KeyEvent e) {
  if (e.isControlDown() && e.getKeyCode == KeyEvent.VK_A) {
    doWhatYouWant();
}Also, you should know that Swing has a better mechanism for mapping keystrokes to actions. Here's how you'd hook up your editor to map CTRL-A to a certain action:
                       // note that "ctrl" is NOT in caps
editor.getInputMap().put(KeyStroke.getKeyStroke("ctrl A"), "myAction");
editor.getActionMap().put("myAction", new AbstractAction() {
    public void actionPerformed(ActionEvent ae) {
        doWhatYouWant();
});Questions welcome :)
Shannon Hickey (Swing Team)

Similar Messages

  • Combining .part with .exe, by downloading an .exe file, doesnt work.

    Hi,
    if i want do download an .exe file, combining .part with the .exe doesnt work because the .exe is opened in explorer.exe.
    .exe cant be deleted, too.
    I download the files to my desktop.
    Every other filextension works perfectly.

    Readers and Writers are for text. For binary data use InputStream and OutputStream.

  • I book doesnt work with power cord only

    Hello. I was just using my ibook g4 and shut it down. When i tried to turn it back on it worked for about 5 minutes then it shut off. I tried taking out the battery and holding down the power button for 5 seconds among other things. I gave up and borrowed a friends battery, he has the same model as me and that battery doesnt work either. I tried just using the power cord only and that doesnt work either. Do i need to take it in to a professional? I've tried just about everything.

    Hey Caesar and Welcome to Apple Discussions,
    So your header reads:
    "i book doesnt work with power cord only "
    Is that right? Will it run only on the battery?
    If so this is from the manual:
    "The computer runs with battery, but not with the power adapter plugged into
    wall outlet
    1. Try known-good power outlet.
    2. Try known-good power adapter and power cord.
    Note:
    Verify that power adapter connector glows amber or green. If the power
    adapter light is green, turn over the computer and press the battery button. The
    battery lights should glow green and stay on if the power adapter is operating
    correctly.
    3. Reset the power manager by pressing the key combination Control-Option-Shiftpower.
    Warning: Make sure you do not hold down the "fn" key when resetting the
    power manager.
    Warning: Resetting the power manager means you will also need to reset the
    date and time (using the Date & Time control panel).
    4. Replace DC board.
    5. Replace logic board."
    and it would help to know exactly which iBook you have but this is pretty generic.
    Richard

  • Ctrl alt delete doesnt work anymore

    Hi,
    We have an HP probook G0 where the combination ctrl alt delete doesnt work anymore.
    - The issue is only with the left ctrl Key. When we use the right ctrl key, ctrl alt delete works
    - When I check the onscreen keyboard in windows, the left ctrl key does react, so the key is'nt hardware defected.
    With external keyboard everything works also fine.
    Laptop has the latest HP updates.
    Any ideas how to solve this issue?
    thx!

    thx prob is solved just had to double-click on the window  , also performed a virus-scan, but no viruses were found, i do use pc-cilin 2002 (up to date) i hope it's sufficient, because norton is way much better, i know, but i just don't want to spend any money on a damn anti-virus prog...just used the one that came with my mobo
    MSI 875P NEO-FIS2R
    Intel Pentium IV 2.6 C Ghz (HT running perfect)
    2x256 MB DDR400 (Dual Channel)
    Maxtor 80 GB S-ATA 150
    CD-RW Lite-On 52x32x52
    MSI Starforce NVIDIA Geforce FX 5900 Ultra 256 DDR
    Windows XP Professional SP1
    greetz

  • My time capsule doesnt work when its conneted direct cable modem, and it start working from netgear router

    I just bought a Airport Time Capsule, time capsule is connected direct from wan to cable modem (it doesnt work). when i connect it to lan port 1, it start working. normal process i know is from cable modem to wan port. 2nd i notice, network is on bridge mode. so my question is how do i make it to work from modem to wan port.

    What model is the modem? Is it a pure cable modem or a combined modem router?
    This maybe important as the current model TC does have issues with some of the popular cable modems.. SB6121 or 6141 being often the ones complained about here.
    If it is a pure cable modem (most will have just one ethernet port). Then power down the modem for 20min. This allows enough time for the MAC address of the first device connected to be lost at the ISP end so it is ready for a new router.
    The TC must be in dhcp and nat mode.
    Please factory reset the TC and start over.
    The Factory Reset universal
    Unplug your TC/AE. Hold in reset. and power the TC/AE back on..  all without releasing reset and keep holding in for about 10sec. The time is not important.. it is the front LED rapid flashing that indicates you are in factory mode.
    Release reset.
    If it doesn’t flash rapidly you have released reset at some point and try again.
    Be Gentle! Feel the switch click on. It has a positive feel..  add no more pressure after that.
    TC/AE will reboot after a couple of minutes with default factory settings and will wipe out previous configurations.
    No files are deleted on the hard disk.. No reset of the TC deletes files.. to do that you use erase from the airport utility.
    By default the TC is in router mode after a reset.
    Restart the modem.
    The power up the TC and run through the setup utility.
    The TC should then be accepted as the main router in the network.
    If this fails check the WAN ip address. If it is 10.x.x.x or some other private IP you did not turn off the cable modem for long enough.. Try again only this time leave it off longer. (Some ISP it is just 5min.. some 15.. some will require 60min or overnight).

  • Related Link doesnt work with Multiple Helpsets

    Robohelpx4.1 is used as the authering tool to generate our help files in OHW format. We have different projects creating one helpset file each and it is merged in the ohwconfig.xml. Each helpset has its own link,map,index,Toc files created by robohelp. The link file created by robohelp has the linkitem id created in seq order and names as Link01,Link02,Link03..... .
    The link file of other helpset also has the same structure and ids. (The linkitem id's are not unique across the helpsets)
    But the related link doesnt work properly when more than one helpset is configured, for both the options of combined book and separate books. Links get mixed up and shows topics of other links.
    Is there anyway this can work ?

    Link Problem with Multiple Helpsets

  • Screen doesnt work, how can i sync?

    hello, im new at this but i have a palm pixi and ive only had it for less than 6 months and the screen stopped working and i want to get my pictures off but it keeps asking me if i want to use usb or charge my phone. and i cant hit use usb because the screen doesnt work! i need help if there is anything i can or cannot do at this point.
     Thank you, Amanda
    Post relates to: Pixi Plus p121vzw (Verizon)

    When you cannot tap on the touchscreen, you can use a keyboard combination to put the device in USB drive mode.
    Use the following procedure to put your device in USB drive mode then copy the pictures.
    1. Connect your phone to your computer using the USB cable.
    2. On your phone, tap USB Drive or press Option + Sym + U.
    On your computer, your phone appears as a removable drive.
    You can then copy and paste the pictures to your PC for backing up.
    For reference purposes, click on the following link for the support page for your device on the kb.palm.com webpage.
    http://kb.palm.com/wps/portal/kb/na/pixi/pixi/veri​zon/home/page_en.html
    There are links on the page to the user guide, troubleshooting, how to's, downloads, etc.

  • MSI GF4 Ti-4200 doesnt work with WindowsXP

    I can't get the MSI display tools to work - it crashes,
    the vbios.dll doesnt load, it also crashes.
    the tv in doesnt work ,it crashes
    the tv out doesnt work ,it crashes.
    all the supplied software also crashes "application has encountered an error and cannot continue. sorry for any inconvenience"
    the intervideo software (windvr, wincoder, winproducer) and MSI PVI software all crashes as well.
    what's the deal with this stuff?  ?(
    I have a Dual AMD athlon Tyan thunder k7 motherboard,
    MSI Ti-4200-VTD video card and MSI tv anywhere card.
    is there any resolution for this?

    I'm sorry gfilitti if I don't have my system listed, but I thought my question was pretty simple...
    Has ANYONE been able to make the InterVideo WinProducer 2 software, that comes with the retail version of the MSI G4Ti4200-VTD64 card, work successfully under the Windows XP Home or Pro operating system?
    If the answer is YES, then I will begin investigating why my system can't.
    If the answer is NO, then I only ask for other people's recommendations of what software WILL work in place of that. I NEED those functions to work. That's why I paid extra for the VIVO.
    All we've heard so far in this thread are NO votes. I would like to see just how widespread this is. If I can find ONE person who claims it works fine on his/her computer under Windows XP, then my NEXT question would be if they had to do anything different to make it run, or was it just a straight install? Did they add the program patch available from the MSI website? See where I'm going with this?
    If you would REALLY like my system details, here ya go...
    ========================================
    CASE - ANTEC SX1000II with 4 internal 8cm fans
    POWER SUPPLY - ANTEC 400W "True Power" w/dual fans
    MOTHERBOARD - MSI 645E MAX (MS-6547 Ver 2.0)
    BIOS - AMI Ver 3.2 (10/21/02)
    PROCESSOR - PENTIUM 4 2.0aGHz (Rev/Step 2/4(9) )
    MEMORY - 1 Corsair 512MB DDR RAM (Winbond chips)
    DISABLED IN CMOS - FLOPPY Controller, AUDIO Device, MODEM Device, Serial Port B, MIDI Port, and GAME Port
    AGP SLOT - MSI G4Ti4200-VTD64 - IRQ 16
      DRIVER: MSI 31.00
      CAPTURE DRIVER -  nVidia 1.08
    SLOT 1 - Creative SB0090 Audigy Sound Blaster - IRQ 17
      DRIVER - Creative 3.0.0.18 9/20/02
    SLOT 1 - Creative SB1394 FireWire Controller - IRQ 18
      DRIVER - MS 5.1.2535.0 7/1/01
    SLOT 2 - NIC #1 D-Link DFE-530TX Ethernet - IRQ 18 (LAN)
      DRIVER - REALTEK RTL8139 5.396.0530.2001
    SLOT 3 - Adaptec 29160N Ultra160 SCSI Controller - IRQ 19
      DRIVER - Adaptec 6.2.0.0 3/19/2002
    SLOT 4 - EMPTY
    SLOT 5 - MSI SYSTEM D-Bracket
    SLOT 6 - NIC #2 NetGear FA312 Ethernet - IRQ 18
      DRIVER - Windows XP Pro native driver
    NOTE:
    NIC #1 is for home LAN
    NIC #2 is for Alcatel SpeedTouch External DSL modem
    SCSI DRIVES:
    ID 0 - COMPAQ (Seagate) ST318451LW, 18GB, 15K RPM
    ID 1 - QUANTUM Typhoon Atlas II, 18GB, 10K RPM
    ID 2 - Seagate ST39103LW, 9G, 10K RPM
    ID 3 - Plextor CD-RW PX-W1219S
    ID 4 - Toshiba DVD-ROM SD-M1201
    ID 5 - EPSON Perfection 1640SU Flatbed Scanner
    ATA/ATAPI DRIVES:
    Primary Master - No Connection
    Primary Slave - No Connection
    Secondary Master - MATSHITA LS-120 Ver F523
    Secondary Slave - No Connection
    USB DEVICES:
    DIAMOND SupraMAX 56K V.92 Model:SUP2920
    Generic Flash Memory programmer and other assorted USB devices on occasion.
    MONITOR - HITACHI SuperScan Pro 21 w/5-BNC input
    ========================================
    BTW, I would think when investigating a program's FLAT refusal to run, that the MOST important things aren't listed in these signature files. It has to do with what ELSE is running at the same time. Which services are running and which are NOT? What memory resident programs are loaded at boot-up? Any service packs installed? How about any security patches from Microsoft? Which anti-virus software (if any)? Which DirectX version? Personal firewall? Etc., etc.
    Granted, the hardware DOES have a factor, but I feel all of these are MORE important factors than the speed or brand of a persons hardware. I look at the signitures more as bragging rights than anything else.
    Now, this is just my opinion and may not reflect the feelings of the more sane people around me.  
    Cheers!

  • Macbook pro 15" mid 2010 i spilled water on keyboard now it wont power on if the battery is connected and the keys on keyboard doesnt work it works fine with no battery and external keyboard if i order a battery and new keyboard will every else work again

    macbook pro 15" mid 2010 i spilled water on keyboard now it wont power on if the battery is connected and the keys on keyboard doesnt work it works fine with no battery and external keyboard if i order a battery and new keyboard will every else work again lik it did before

    If you have records that show that you've taken your MacBook Pro in for a year to fix the machine, I would escalate the problem to Apple Customer Relations - unfortunately I don't have a number for Spain.
    It would only seem logical to me that if you've been trying to have the machine repaired during the time that the 'recall' was in effect that you should be eligible for a new logic board. But only customer relations will be able to make that call.
    Good luck - take the issue as high up the food chain as you can and see what happens.
    Clinton

  • On Safari, ipad connects to the internet.  But when in applications such as Keynote, I try to e-mail presentattion it doesnt work.

    I am a teacher and have my own iPad with a data plan.  We also have a router in teh classroom for wifi, and it has a very strong signal.  On Safari, the ipads can connect to the internet.  But when in applications such as Keynote and HTML Egg, I try to e-mail presentat. or post website to web, it doesnt work.  I tried re-setting the proxies and the router, no luck.  Please Help!  I am a teacher and want my students to be able to post their websites on to the web, and e-mail themselves and their parents their Keynote Presentations.

    Try this. Turn your iPad Off. Then disconnect the power going to the router for 30 seconds or longer. Then replug the power to the router (allow it to initialize) and turn On the iPad. Hopefully everything will connect. If not, see below.
    iOS: Unable to send or receive email
    http://support.apple.com/kb/TS3899
    Can’t Send Emails on iPad – Troubleshooting Steps
    http://ipadhelp.com/ipad-help/ipad-cant-send-emails-troubleshooting-steps/
    Setting up and troubleshooting Mail
    http://www.apple.com/support/ipad/assistant/mail/
    iPad Mail
    http://www.apple.com/support/ipad/mail/
    Try this first - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.)
    Or this - Delete the account in Mail and then set it up again. Settings->Mail, Contacts, Calendars -> Accounts   Tap on the Account, then on the red button that says Remove Account.
     Cheers, Tom

  • I've just installed CS6 creative suite mainly for photoshop CS6. It comes with camera raw 7.0.something, but need something newer to use my canon 6d. When I download camera raw 8.5 and install the raw converter doesnt work anymore, wont even open or isnt

    I've just installed CS6 creative suite mainly for photoshop CS6. It comes with camera raw 7.0.something, but need something newer to use my canon 6d. When I download camera raw 8.5 and install the raw converter doesnt work anymore, wont even open or isnt available anymore in the plugin list. Tried to reinstall everything for a few times, but nothing helps.

    When I search for updates the raw converter doesnt get update automaticly. Frustrating, is costing me the whole morning.

  • I am locked out of my computer (macbook air) I just got it back from the apple store and they reset it. I put in a new password, and now it doesnt let me log in anymore. Command R doesnt work, all i hear is a sound, but nothing happens.

    I just got it back from the apple store and they reset it (becuase it kept shutting down and not turning back on).
    I put in a new password because i needed to start over from factory settings, but now it doesnt let me log in anymore. (I don't know if this is because it doesnt accpet my password, or I forgot my password in less than 5 minutes, or because when i typed in my new password, i typed it in wrong twice)
    Command R doesnt work, all i hear is a sound, but nothing happens.

    What I don't understand is why it is rejecting a password I am creating.
    Perhaps the password you are creating is too short, or has characters that are not allowed, or is not secure enough because it is a word in a dictionary.
    FileVault may have standards for what it considers an acceptable password. If the password is part of the 128-bit encryption scheme, it might have to be 16 characters, for example. (Don't know if that is true, but it's a possibility.) Check your documentation for password requirements.

  • Scrolling and rightclicking with magic mouse doesnt  work anymore

    Suddenly scrolling and rightclicking with magic mouse doesnt work any more. Left clicking and cursor moving works normal. I have checked the system preferences for the mouse and find nothing strange or unchecked. Any ideas?

    Also tried the universal access thing. Doesnt work.

  • People Cannot Hear Me When I make Calls on iPhone 4, Bought a new iPhone 4, uploaded all of my own information from the backup, and it still doesnt work, help!

    I went in to apple, they couldnt figure it out, I am on AT&T so I was figuring on going into their store today and seeing if its something with the network, if not I am going back to apple, but this is literally a brand new phone i bought yesterday, not refurbished or anything, brand new, does anyone know why this isnt working? Everything else works fine, the mics both work, its just when I make calls or someone calls me the mic doesnt work.

    When you see the same issue on more than one hardware device, it means that the problem is likely to exist outside of the hardware.  Two things to investigate would be the software/firmware on the backup and issues with the cellular network.  It's probably safe to rule out the cellular network as well.
    First, make sure that you have imported copies of all the information (pictures, videos, documents) on the device.  Do this thorough itunes, and the applications (photographic and document processing) on your computer.  Perform a firmware update then restore the device as new.  If the problem persists, then you may actually have the worst luck and discovered two devices with an identical issue.
    Read each of the steps before initiating the DFU.
    !.  Connect the iPhone to any computer running a fully updated version of iTunes.
    2. Press and hold both "home" and "sleep/wake" buttons
    3. After eight seconds let go of only the sleep/wake button.
    4. Keep holding the home button until you see a popup mesage in iTunes.
    5. Read all all the popups, then use iTunes to update the iPhone's software.
    If the popup fails to show, repeat steps 2 through 4

  • My iphone 4 is stuck on the reboot logo, ive ried holding both home and power to shut it off snd then keep holding home to let you plug it into itunes but it doesnt work. what do i do?

    my iphone 4 is stuck on the reboot logo, ive ried holding both home and power to shut it off snd then keep holding home to let you plug it into itunes but it doesnt work. what do i do?

    Did you try rebooting the iPad? You will need to have some battery power for this.
    Reboot the iPad by holding down on the sleep and home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons.
    This may be helpful
    iPhone, iPad or iPod touch: Not responding or does not turn on
    Frozen or unresponsive iPad - Apple
    iPad: Unable to update or restore

Maybe you are looking for

  • Error 1314 in the Solution Manager Installation

    I'm installing Solution Manager 4.0 SR1 in Windows 2003 + Oracle 10g. In the second step of the "Task Progress", "Create users for SAP System" I've the error message : "ERROR 2007-03-15 18:07:29 FSL-00001 System call failed. Error 1314 (A required pr

  • Updated to Map ver 0.1.23.112

    Just updated today with 1,122.22 MB of new data in this version. The update process deleted my old map data and replaced with new data according to the countries/regions that I had in my N95 8GB previously. So far, it is working fine with GPS fix in

  • Lenovo Vibe X2 missing language

    Recent update popped up, so I decided to install it. When I reboot my multilanguage was gone. Only English and Chinese language is available. Any solutions..? I have downloaded a new firmware, but I can't install via Flashtool.

  • TS3899 Why can't I reply to emails on my iPhone 5 - this is a recent problem, I have been able to reply and delete email messages previously.

    Why can't I reply to emails on my iPhone 5 - this is a recent problem, I have been able to reply and delete email messages previously.

  • J2SE Bluetooth API

    Hello, I�m working on a project where I have to build a bluetooth server to connect Mobiles to it. The problem I have is to find an API to use bluetooth under J2SE. It seems to be easy to find that for J2ME, but not for J2SE. I found something on ben