Keyboard input regardless of focus

Dose anyone hav a way of accepting keyboard input using keyListeners or something else even when my Jframe windowis not the window in focus?
Any help is appreciated.

pinktux777 wrote:
Yea, I suppose...
I was hoping not to, but it looks like I will be going that way.
The project I'm working on is a "challenge" by my teacher based on the AP Java "Gridworld" environment. I'm not sure if modifying the environment itself meets the restrictions of the challenge, but that seems best from a strict programming aspect.
If anyone has a solution to my original problem, I'm still interested.Whoa, I'm not sure that you want to modify any code here. You'd be much better off seeing if you can subclass from this code rather than modify. That's what OOP is all about. Even if the JFrame you are talking about is private, there still may be ways of using OOP to modify its behavior. BTW, what is "gridworld"?

Similar Messages

  • Keyboard input without focus

    Hi !!
    Does anybody know how to write an application that catches the keyboard input all the time, regardless if other application has the focus. I want something like a windows service that runs in the background an catches all keyboard input. Can anybody give me an ideea ??

    this can only be done using a hook...and hooks can only be done using native code....like c/c++/assembler for the operating system.

  • Focus for keyboard input

    I have a VI that, when started, starts another vi that runs in a
    different part of the screen. I want the user to be able to use the
    keyboard and the original VI be the one that receives the keyboard input
    (key navigation, etc.). How do I get the focus back on the original VI
    without "clicking" on it with the mouse?
    -Stephen

    Try using Property Node under Application Control. Set the class to VI.
    Set FP.IsFrontmost to true. Wire the name of the original vi to the Open VI
    Reference function and then wire the output vi reference to the property
    node. This should return keyboard control to the original vi. If you want
    a specific control within the vi to have focus initially, right click on the
    control and create a property node. Select KeyFocus for the property,
    select Change All To Write, and wire true to the property.
    "Stephen" wrote in message
    news:[email protected]..
    > I have a VI that, when started, starts another vi that runs in a
    > different part of the screen. I want the user to be able to use the
    > keyboard and the original VI be the one that receives the key
    board input
    > (key navigation, etc.). How do I get the focus back on the original VI
    > without "clicking" on it with the mouse?
    >
    > -Stephen

  • Troubleshoot keyboard input problem

    the right hand shift key, and full stop, have stopped working. When I attached a different apple keyboard the same thing happened to it. The only way I can get a full stop is with the numeric pad, and the only way to get shift is with the left hand shift key. Does anyone have a solution, please?

    Well, the game is a bit big now, but the problem is definitely in the file GameBoard.java, and my source is:
    http://userpages.umbc.edu/~cbutle3/space.zip
    It is simply a Space Invaders Game. I have gotten almost everything working but keyboard input. I have it set up now so that the game even plays itself, cuz it doesn't listen to my button presses :)
    I really want to add a KeyListener to the JPanel (the GameBoard extends JPanel) so that keyboard input is invisible, but it won't let me - says the GameBoard never has focus and just ignores it. So to get any key input to work at all, I temporarily added a TextField to the panel, and added the KeyListener to the TextField. That's part of the problem. And the main problem is that inside the "gameplay" loop, the KeyListener has no effect. I tried making a new class with a run(), putting the KeyListener in there and calling start() from the GameBoard, but it had the same outcome. Please help! :)
    -chris

  • Just started with NetBeans IDE, need to capture all keyboard input!

    Hello,
    I discovered that I can only capture keyboard events when my GUI application has focus. Ok, but I need a functionality that can capture all keyboard input, even if my application runs in the background or in the system tray.
    How can I achieve that?
    Regards,
    Mirza

    I know...sorry, didn't mean to imply otherwise.Don't worry about it; I wasn't offended. (I didn't think that that was what you were tying to do.) I was trying to (subtly) take this a different direction. (Was going to write something Solaris specific or perhaps something in ASM that would effectively do what the O/P wanted. Seeing as how Key Loggers only serve one practical purpose - as far as I know - I just wanted to give him code that he could do nothing with.)

  • OSX/SL 10.6.8 all window apps lose keyboard input; mouse and cmd-N work for spaces

    Input suddenly stops going to all applications, from MacBook Pro and wireless keyboards, and from "Show Keyboard viewer" (OSX 10.6.8 'Snow Leopard', MacBook Pro). Though the OSX Keyboard Viewer shows the keys onscreen as they are pressed on the MacBook and wireless keyboards. 'Spaces' responds to cmd-N commands, but no input is possible to any running or newly-started 3rd party or Apple-provided application. Killing off applications one by one doesn't recover keyboard input ability;  a complete reboot appears necessary to restore the ability to key input into applications. This happens repeatedly, yet never registers as an OS/X 'crash' because 'Force Quit'ting applications and restarting is still possible using only the magic mouse or trackpad.   No data  whether only logging out and back in would correct the apparent input-focus disconnect of all applications with the window manager. There may be some way to restart the window manager by using the mouse to open up new apps and/or cut and paste characters ( including a carriage return ) or cut and paste entire saved typed commands into a terminal window.

    Do a backup, using either Time Machine or a cloning program, to ensure files/data can be recovered. Two backups are better than one.
    Try setting up another admin user account to see if the same problem continues. If Back-to-My Mac is selected in System Preferences, the Guest account will not work. The intent is to see if it is specific to one account or a system wide problem. This account can be deleted later.
    Isolating an issue by using another user account
    If the problem is still there, try booting into the Safe Mode using your normal account.  Disconnect all peripherals except those needed for the test. Shut down the computer and then power it back up after waiting 10 seconds. Immediately after hearing the startup chime, hold down the shift key and continue to hold it until the gray Apple icon and a progress bar appear. The boot up is significantly slower than normal. This will reset some caches, forces a directory check, and disables all startup and login items, among other things. When you reboot normally, the initial reboot may be slower than normal. If the system operates normally, there may be 3rd party applications which are causing a problem. Try deleting/disabling the third party applications after a restart by using the application un-installer. For each disable/delete, you will need to restart if you don't do them all at once.
    Safe Mode - About
    Safe Mode

  • Keyboard input delay Flex/AIR

    I've build an AIR desktop app that uses an USB barcode scanner. To capture the token provided by the barcode scanner an input field is used.
    When testing the barcode input was only partially captured by the scanner. This was caused by the barcode scanner's input coming in the fast. Increasing the key stroke delay of the barcode scanner (config tool from motorola) solved the problem however this is not ideal.
    Does anyone has experience with this type of problems? What is an approach to solve this? Maybe by writing an Java compagnion app that captures the keyboard input?

    I just ran into this same problem. Our users are scanning barcodes from various labels using various types of scanners (changing the delay using scanner software wasn't an option). We also have to allow them to scan to a TextInput within a DataGrid, which created even more problems. There were 2 very interesting things I learned in coming up with a solution for this one:
    1. As mentioned previously, the scanner inputs the data so quickly that the enter key event is often processed before the change event for the text. I tried several solutions (like trying to force the change event before the enter key is processed), but learned that the best solution was just to add the delay as mentioned in previous posts.
    2. When adding to a DataGrid control, I learned that both the DataGrid's & the TextInput's key down events are fired by the same SystemManager event. Though you can override the TextInput's keyDownHandler, you can't override the DataGrid's because it's a private method. So, even though my delay was being processed in the TextInput, the DataGrid was forcing control away from it and moving to the next item in the grid. To get around this one, I had to stop propagation of the event from the TextInput, then re-start the DataGrid's event once the delay was complete. I also had to process a focus-out event to get it to move to the next item in the DataGrid.
    Here's the code I used inside a custom TextInput control to handle processing both stand-alone and inside a DataGrid:
    override protected function keyDownHandler(event:KeyboardEvent):void
          // If the enter key was pressed, then we need to add a delay.
          // Barcode scanners quite often process the enter key before the TextInput
          // control has time to finish processing all the text. (e.g., Instead of
          // getting 12345 as a text entry, you could get 123 or 1234.)
          if (event.charCode == Keyboard.ENTER)
               // If this is the first time we've processed the enter key, we need to
               // add the delay.
               if (_keyboardEvent == null)
               _keyboardEvent = new KeyboardEvent(event.type, event.bubbles,
               event.cancelable, event.charCode, event.keyCode, event.keyLocation,
               event.ctrlKey, event.altKey, event.shiftKey);
               event.stopImmediatePropagation();
               barcodeTimer(_keyboardEvent);
                          return;
               // If the enter key is pressed while we are still in the delay, ignore
               // it.
               else if (_keyboardEvent != null && _keyboardEvent != event)
                         return;
               // If the delay is complete, then we need to restart events related to
               // the enter key so the control is handled properly.
               else
                    super.keyDownHandler(event);
                    // If the TextInput is inside a DataGrid, then we need to dispatch the
                    // DataGrid's key down event. We also need to make sure the proper
                    // focus change happens (since this was stopped in the original event
                    // propagation).
                    if (parent != null && parent.parent != null &&
               parent.parent is mx.controls.DataGrid)
               parent.parent.dispatchEvent(event);
               dispatchEvent(new FocusEvent(FocusEvent.KEY_FOCUS_CHANGE, true,
                              false, null, event.shiftKey, Keyboard.TAB));
            _keyboardEvent = null;
                    return;
          super.keyDownHandler(event);
    * This is a copy of the keyboard event to be processed once the barcode
    * delay is complete.
    private var _keyboardEvent:KeyboardEvent = null;
    * This method launches a timer of sufficient length to allow barcode
    * scanner text to be processed before it re-launches the keyboard event.
    * @param event This is the key-down event to be restarted once the timer is
    * complete.
    private function barcodeTimer(event:KeyboardEvent):void
          var t:Timer = new Timer(30, 1); // 30 ms
       t.addEventListener(TimerEvent.TIMER,
               function():void
               keyDownHandler(event);
       t.start();

  • Thunderbird 24.6.0 suddenly stops accepting keyboard input in the middle of typing a message

    On a system running Debian Testing (kernel version 3.13.10-1), at times Thunderbird 24.6.0 suddenly stops accepting keyboard input in the middle of typing a message. Some times, it will not accept keyboard input from the time a new message window opens (both from click Write or Reply).
    Regardless of when the problem starts, I can still copy text from another source and paste it into the message, and I can still send the message.
    Sometimes, the problem will clear up itself after a few minutes, meaning I can suddenly start typing in the open message window, but sometimes not, and I will have to close the message window and restart Thunderbird or reboot the system.

    Tasks: 290 total, 1 running, 242 sleeping, 47 stopped, 0 zombie
    %Cpu(s): 1.0 us, 0.3 sy, 0.0 ni, 98.2 id, 0.4 wa, 0.0 hi, 0.0 si, 0.0 st
    KiB Mem: 8101216 total, 6406932 used, 1694284 free, 46440 buffers
    KiB Swap: 8388604 total, 280476 used, 8108128 free. 2714812 cached Mem
    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    9498 pete 20 0 905252 171068 60844 S 4.3 2.1 0:36.22 chrome
    1207 root 20 0 301372 31896 12592 S 1.0 0.4 40:04.04 Xorg
    7904 pete 20 0 796904 75304 25496 S 1.0 0.9 0:54.16 chrome
    7349 pete 20 0 1215536 345724 116416 S 0.7 4.3 3:29.51 chrome
    7539 pete 20 0 879076 128096 26512 S 0.7 1.6 1:51.35 chrome
    7670 pete 20 0 826900 70488 23812 S 0.7 0.9 0:13.12 chrome
    7793 pete 20 0 872564 135004 68628 S 0.3 1.7 0:13.74 chrome
    7845 pete 20 0 811680 80360 23580 S 0.3 1.0 0:06.61 chrome
    7877 pete 20 0 812032 79888 23668 S 0.3 1.0 0:08.91 chrome
    9666 pete 20 0 23796 1808 1136 R 0.3 0.0 0:00.01 top
    22931 pete 20 0 1094964 186504 22808 S 0.3 2.3 14:28.61 thunderbird
    1 root 20 0 193016 2860 1260 S 0.0 0.0 0:03.67 systemd
    2 root 20 0 0 0 0 S 0.0 0.0 0:00.02 kthreadd
    3 root 20 0 0 0 0 S 0.0 0.0 0:22.21 ksoftirqd/0
    5 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/0:0H
    7 root 20 0 0 0 0 S 0.0 0.0 1:09.66 rcu_sched
    8 root 20 0 0 0 0 S 0.0 0.0 0:00.00 rcu_bh
    9 root rt 0 0 0 0 S 0.0 0.0 0:00.34 migration/0
    10 root rt 0 0 0 0 S 0.0 0.0 0:00.58 watchdog/0
    11 root rt 0 0 0 0 S 0.0 0.0 0:00.58 watchdog/1
    12 root rt 0 0 0 0 S 0.0 0.0 0:00.01 migration/1
    13 root 20 0 0 0 0 S 0.0 0.0 0:13.05 ksoftirqd/1
    15 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/1:0H
    16 root rt 0 0 0 0 S 0.0 0.0 0:00.50 watchdog/2
    17 root rt 0 0 0 0 S 0.0 0.0 0:00.02 migration/2
    18 root 20 0 0 0 0 S 0.0 0.0 0:04.84 ksoftirqd/2
    20 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/2:0H
    21 root rt 0 0 0 0 S 0.0 0.0 0:00.52 watchdog/3
    22 root rt 0 0 0 0 S 0.0 0.0 0:00.03 migration/3
    23 root 20 0 0 0 0 S 0.0 0.0 0:11.02 ksoftirqd/3
    25 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kworker/3:0H
    26 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 khelper
    27 root 20 0 0 0 0 S 0.0 0.0 0:00.00 kdevtmpfs
    28 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 netns
    29 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 writeback
    30 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kintegrityd
    31 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 bioset
    32 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kblockd
    34 root 20 0 0 0 0 S 0.0 0.0 0:00.11 khungtaskd
    35 root 20 0 0 0 0 S 0.0 0.0 3:41.37 kswapd0
    36 root 25 5 0 0 0 S 0.0 0.0 0:00.00 ksmd
    37 root 39 19 0 0 0 S 0.0 0.0 0:00.00 khugepaged
    38 root 20 0 0 0 0 S 0.0 0.0 0:00.00 fsnotify_mark
    39 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 crypto
    44 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 kthrotld
    46 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 deferwq
    86 root 0 -20 0 0 0 S 0.0 0.0 0:00.00 ata_sff
    88 root 20 0 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_0
    89 root 20 0 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_1
    90 root 20 0 0 0 0 S 0.0 0.0 0:00.00 scsi_eh_2

  • Keyboard input for plugins

    Hi,
    Is there some way I can assign keyboard input exclusively to plugin windows when they're in focus. Currently, when I type numbers or use the cursors, Logic is responding behind the plugin window and the plugins do not get the key press notifications. This means I can only use the mouse to enter input - that makes entering a License Key VERY DIFFICULT if it includes numbers!
    Thanks in advance for your help,
    Alex

    Just to clarify... I'm talking about my laptop keyboard, not a musical keyboard.
    I'm kind of bummed that nobody has replied yet... can I be the only person who is having this problem?!?
    I've tried this with native plugins too and get the same problem. The Logic Express 8 manual states that you can alter the value in a plugin by clicking on the numeric display and typing in on the keyboard. I tried that but when I try to type, the numbers activate their associated 'screensets'. I've even unmapped the number keys from the screensets and am able to use the numbers now, but there are other keys that do undesirable things in Logic that I don't want to have to 'unmap'. Also, I want to be able to use the cursor keys 'up' 'down' etc to choose options in plugins - but they change channels etc in Logic instead of being picked up in the plugin.
    I can't be the only person with this problem can I? Please if you're reading this can you give it a try and post back here describing your experiences.
    THANKS!
    Alex

  • Keyboard input failure in 2nd java applet

    The (London) Times offers crosswords developed as Java applets. With Mandriva 2007 newly installed on my laptop (Firefox 1.5.0.8, JRE1.5.0_08), I completed one crossword and loaded a second: no keyboard input to cells, no focus shown on cells. Killed the applet, reloaded: same problem. Quit Firefox, restarted crossword: same problem. Quit session, restarted, reloaded Firefox and crossword: same problem.
    Upgraded to Firefox 2.0 and JRE1.5.0_09. Started a crossword with a couple of entries, quit and started a second: same problem - no focus on cell, no input.
    I think this is connected in some way with Mandriva 2007, because the combination Mandriva 2006 with Firefox 1.5.0.7 and JRE 1.4.2-09 works correctly.
    I believe the problem lies initially with Java, because keyboard input to non-Java pages in Firefox worked without problems.

    I have exactly the same problem with opera 9.02 browser, jre1.6, linux debian sarge and the crossword puzzle of "Le Monde" http://www.lemonde.fr/web/article/0,1-0@2-3280,36-139043,0.html
    It worked with jre 1.4 linux FC2, same opera.

  • TS3280 How can i enable both paired bluetooth and ios keyboard input at the same time?

    How can i enable both paired bluetooth and ios keyboard input at the same time?
    This is needed for the app im working on. Need some user input via keypad as well as scanner input via a paired bluetooth scanner.

    You probably should not be using a keyboard bluetooth profile for a scanner, I am not a developer for apple so do not know the location for you to find out the correct profile you should be using for an input device that is not a keyboard. Sorry,
    I am sure if you navigate the apple developer site you will probaly finmd what you're looking for.
    https://developer.apple.com

  • I have a new mac book pro (sept 2014) and am suddenly stuck on the log-in screen. Keyboard input not working to enter my password. Already tried a basic restart and a cmmnd/ cntrl/ pwr troubleshoot to no effect.

    I have a new mac book pro (sept 2014) and am suddenly stuck on the log-in screen. Keyboard input is not working to enter my password. Seems to be a log in issue as keyboard works for forced troubleshooting. (And b/c when I first noticed the problem, I was able to enter my log in password but then everything sort of froze. Now, no ability to enter the password.) Already tried a basic restart and a cmmnd/ cntrl/ pwr troubleshoot to no effect.

    Reset PRAM:   http://support.apple.com/kb/PH14222
    Start up in Safe Mode.
    http://support.apple.com/kb/ph14204
    A new Mac is in warranty for 1 year from the date of purchase.
    A new Mac comes with 90 days of free tech support from AppleCare.
    AppleCare: 1-800-275-2273
    Call AppleCare or take it to the Apple store to have it checked out.
    Genius Bar reservation
    http://www.apple.com/retail/geniusbar/
    Best.

  • How to have same keyboards input source in Mac and Windows???

    I use Canadian French-CSA on my Mac keyboards input source. Using Windows 7, I can't find the good setting for my keyboards to be the same when I it keys.
    I run Windows over Parallels Desktop
    Can anybody help?
    Thank you

    Can I use an AirPort Extreme Base Station "n"
    Yes.
    and if so, will my MacBook work with this at maximum download / upload speed (i.e. equivalent to the cable)
    The speed of your internal network generally is much much faster than the speed of your internet connection. Unless he has an internet connection faster than approx 6Mbps then even dropping down to the old 802.11b Airport would not seen any decrease in speed of downloads etc...
    and will my brother's PC's also be able to connect?
    If his PC is 802.11b/g-compliant, it shouldn't have any problems connecting to the AirPort base station.
    Or is there another Airport base station?
    The other AirPorts would work, but the AirPort Express & older 802.11g AirPort Extreme base stations have a max. range of 150 feet.
    OR-- should I head down to "Generic Computer Store" and just by a wireless router (WiFi)(think that's what they call them) and connect this to his cable modem? IF SO WILL THAT WORK FOR MY MAC?
    That is always an option as well, especially since he will be the primary user throughout the year. I'd suggest going with a brand name, like Belkin, D-Link, or Linksys for the wireless router choice.

  • How to use the phone's Mini-Keyboard Input with the 'Textbox'(MIDP2.0)?

    (My apology. My English is not perfect but I'll try my best. >_<)
    Hi. I'm trying to create a textbox(in my own little application) that is compatible with the mini-keyboard input feature.
    This problem involved any device that have a built-in "mini-keyboard".
    Problem:
    I tried the 'Textbox' class from MIDP2.0 but the result, as expected, is like using the phones with no built-in keyboard.
    (Forexample if I want to input the character 'C' inthe text box, I need to press number '2' button three times to let it circle through 'A' -> 'B' then 'C'. )
    Then I tried entering URLs in the phone's built-in web browser, the result is I can use the mini keyboard to type like a PC keyboard.
    Question: How do I implement such textbox that is fully compatible with the built-in mini Keyboard?
    I tried browsing through the MIDP2.0 API but it seems the 'Textbox' class there couldn't do it.
    Thank you. =)
    /bow
    Edit/Delete Message

    The textbox should have input just as any other normal phone input. If not, something strange is going on.
    Anyway , there is no use to make your own input method, since every phone has another implementation of this anyway. It would only confuse users.

  • Firefox and Thunderbird are suddenly not accepting keyboard input

    Keyboard shortcuts still work just input in any kind of input field fails so I can still use ctrl+C / CTRL+V to somewhat use firefox and Thunderbird But all input fields are completely unresponsive to keyboard input
    The problem suddenly arose while I was browsing.
    I have the same issue on all program's based on the Gecko engine and I confirmed them so far in Firefox, waterfox, instantbird, thunderbird and fossamail. However chromium / windows / basically everythign n
    To fix it I tried the following:
    Restarting firefox
    Restarting firefox in savemode
    Rebooting
    Changing the keyboard layout in windows
    Using a different keyboard
    Again rebooting
    Pressing F7 to check for caret mode which was disabled
    pressing winkey + F9 (Whatever that does)
    I am running windows 8.1(x64)

    Solved, Changing the keyboard layout again and rebooting fixed it. I tried using the on screen keyboard which worked so I changed the keyboard layout again and rebooted and now it works just fine. I still wonder what caused a Gecko wide issue like this?

Maybe you are looking for

  • Notes in iCal

    Is there a way to make notes visible in Day or Week view without opening the event's edit window? Thanks.

  • Problem about java table.help me

    i have two pages.one pages i enter the data and another page i use a table where it shows me the enter information.But when i enter the data it successfully enter access database.but it does not show me in the table.if i set a button to table page fo

  • Updating bseg and bsis table ...

    Hello, I want to update bseg and bsis table. I guess i will have to use BAPI_ACC_DOCUMENT_POST. how do i go on using this BAPI ? any starter code snippet ...!!

  • Email confirmation regarding shipping of equipment has my name wrong

    I ordered a Cablecard and was sent an email confirming the shipment and delivery date. Mail Tracking Id : {edited for privacy} The message starts with:  NICO, The package containing your FiOS® equipment  But then the message ends with: {edited for pr

  • Sony Vegas Metadata and File tagging?

    Howdy! I used to use Sony Vegas on the PC and have made the switch to FCP. Im liking all that I see but there was one feature that was great in vegas that i can't find in FCP. It was the ability to tag your clips eg "falls" "Dave" "Bride" "Somersault