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.

Similar Messages

  • Read keyboard input as binary

    how can i read keyboard input as binary

    7biscuits wrote:
    I want to be able to get keyboard input as binary as the key is being pressed, without having to press enter,That requirement should have been posted in your original question!
    7biscuits wrote:
    This is required to enable my program respond to (ctrl , alt , shift , F1 , F2 etc) key's.
    Does anyone know how to do it?Reading keyboard input without pressing return on the standard shell (command prompt), this is not possible with Java.

  • 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

  • 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"?

  • 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.

  • 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.)

  • [Solved] Programs hang on keyboard input (uim-xim)

    Update: I've narrowed the issue down (via trial and error) to uim-xim.  If it's running, it causes this problem (in XMonad) and if it isn't, gnucash has no issues.  Oddly enough, when I start uim-xim by hand after gnucash, it works fine too.  Starting uim-xim by hand before gnucash results in the same issue, and so I'm inclined to believe it's either an issue with XIM implementation, or simply uim-xim.  Might also be a mixture of XMonad and uim-xim, as it works fine in Openbox.
    I've noticed lately that certain GTK programs (I'd list them, but I haven't paid close attention until today, where I was using gnucash) work fine until I try to input anything via the keyboard.  The moment I start typing (or, at the latest when I hit the shift key or backspace key) the program will hang (without any error message).  I originally assumed that this was an issue with the program - not my window manager.  However, I tried one of the problem programs (gnucash) in Openbox today, and it works just fine.  That leads me to assume it's caused by my configuration in some way.  I have absolutely no idea where to start debugging this issue. 
    A bit of information:
    I use UIM (in both openbox and XMonad with identical configurations), run a script for a Japanese date format in XMonad (piped to dzen), and load the same xmodmap file in both window managers.  Also, I start all my window managers using CDM (Console Display Manager), but in the case of XMonad I supply a bash script instead of the binary, in order to preload certain files.  Also, I use a german keyboard layout.
    <I removed the rest of this post because it was long and, ultimately, irrelevant>
    Last edited by lswest (2012-05-01 09:53:46)

    spectater wrote:
    Same situation, Confirmed here
    I'm having the same problem with my laptop after upgrading to  gnome 3 : 
      gnome-terminal  , gedit  can not accept  keyboard input , lower case letters, enter ,   backspace and so on ,   but  upper case letters are OK.
    files  can not be renamed with  nautilus , also the find function affected  in nautilus
    while other programs such as  xterm ,firefox  , pidgin  skype , thunar  leafpad  libreofficecan  ...and so on  work out of the box .
    lower case & upper case letters all are not accepted well in my case.

  • 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 Output Problems on Mac OS X

    Hey guys,
    I'm at college studying Java, however my teacher and the rest of the class all use the Kawa IDE, I've been using Project Builder, provided with Mac OS X. Our tutor gave us a class made up of various methods which the college designed to handle keyboard Input and Output, however when I import it I get unpredictable results. I've put it online at: http://www.lostroom.co.uk/inout/
    All I'm trying to do is run a simple program;
    import InOut;
    class CostReckoner
    public static void main(String[] args)
    // Declare the variables
    int quantity;
    double unitCost, basicCost, vatCost, totalCost;
    double vatRate = 0.175;
    // Input the number of items and the cost per item
    System.out.print("What is the unit cost of the items?");
    unitCost = InOut.readDouble();
    System.out.print("How many items in the order?");
    quantity = InOut.readInt();
    // Calculate the cost of the order
    basicCost = unitCost * quantity;
    vatCost = basicCost * vatRate;
    totalCost = basicCost + vatCost;
    //Output the total cost of the order
    System.out.println("Cost �"+InOut.format(basicCost,2));
    System.out.println("Vat �"+InOut.format(vatCost,2));
    System.out.println("Total �"+InOut.format(totalCost,2));
    I seem to need to press space bar after I input anything, as it doesn't recognise "Return" without it. Any ideas ??
    Strange thing is it seems to work fine on the PC Kawa IDE within college. Any advice you guys could offer would be really appreciated. Send me an email at: <[email protected]> if you can help.
    Regards, Gareth

    Hi thanks for your help, I tried compiling the code you gave me to read the streams, however I seem to be have problems with it.
    ERROR
    keys.java:18: unreported exception java.io.IOException; must be caught or declared to be thrown
    n=stream.read();
    HERE IS THE CODE I'M TRYING TO COMPILE
    import java.io.*;
    public class keys {
    public static void main(String[]arguments)
    BufferedInputStream stream = new BufferedInputStream(System.in);
    int n=0;
    while(true){
    n=stream.read();
    System.out.println(Integer.toHexString(n));
    if (n==0x30) break;// this termination condition is optional
    Any ideas ??

  • 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();

  • Process keyboard commands without prompting

    I am 5 weeks into my first Java course with no previous programming background. We are implementing John Conways game "LIFE" a 2D Cellular Automata. From the command line I read in 5 args, width, height, cell size, delay and a random seed value. I have the program accepting the args and drawing the displays. While the program is running the user should be able to type in commands such as quit, step which one steps the display etc. Everything I have done so far, tried or read such as System.in or .next or hasNext prompts the user for input. How do I read keyboard commands without prompting the user? Please don't laugh at my ignorance. Maybe at 48 years old I'm just too old to learn this stuff. Thanks much.

    I am 5 weeks into my first Java course with no
    previous programming background. We are implementing
    John Conways game "LIFE" a 2D Cellular Automata. From
    the command line I read in 5 args, width, height,
    cell size, delay and a random seed value. I have the
    program accepting the args and drawing the displays.
    While the program is running the user should be able
    to type in commands such as quit, step which one
    steps the display etc. Everything I have done so far,
    tried or read such as System.in or .next or hasNext
    prompts the user for input. How do I read keyboard
    commands without prompting the user? Look at the KeyListener interface. You need to know how to use Interfaces, and how to implement listeners for your swing components. With a KeyListener, you can detect when keys are typed. This is event driven. so you perform actions on the key being pressed and released. the keyTyped() method is probably what you will want to use. If you are planning on using single key commands (q == quit, s == step), this will be pretty easy to use. If you want the user to spell out the command, you may want to detect a key stroke, then open a text input field for the user to type the full command.
    Please don't
    laugh at my ignorance. Maybe at 48 years old I'm just
    too old to learn this stuff. Thanks much.Not.
    Good luck.
    � {�                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Automatic keyboard input

    I have a pre-packaged program (an installer) that when it is run, it comes to points where it needs keyboard input from the user.
    "Choose one of the choices:
    1 - do this
    2 - do that
    3 - do something else"
    waits for input
    User: "1"
    continues on
    Is there a way of emulating that user input so that a java program that runs the installer could input the keyboard information to the installer without any user input. In other words, I want a java program to run the installer from start to finish without any user intervention.
    I don't have access to the installer so there isn't the option of changing the installer (and even if I did, I wouldn't have it as an option).

    this question has been asked a million times
    search the forums first for general how-to questions like this
    include Robot in your search

  • Keyboard input lost on desktop actions

    If I change the name of a file on the desktop, I find that often this can result in complete loss of keyboard input as far as file names are concerned – i.e., it becomes impossible to change file names, name new files or make any keyboard input whatsoever. This can happen almost at once, or after an indeterminate number of file names have been changed; there seems to be no pattern or logic to the phenomenon. Suggestions?

    I am having a hard time finding any common thread to this event. The last time it occurred, last night, I was running the following applications:
    Firefox v 2.0.0.1
    Entourage v 11
    Word 2004 v 11
    Photoshop CS v 8
    Preview v 3.0.7
    QuickTime v 7.1.3
    Silverfast launcher v 2.1.2
    Microtek Scanner Finder v 3.24
    Otherwise:
    Startup item: Microtek Scanner Finder v 3.24
    APE extensions: Don't think any; I don't recognise the term.
    Attachments: Printer (Epson Pro 3800), Scanner (Microtek i800), external hard drive, USB modem. However, I had these attachments even before the problem cropped up.
    Finally, I have also run repairs and permissions corrections from Disk Utility without discovering any problems.
    Many thanks for your help!

  • Keyboard input source change not being saved.

    Since upgrading to 10.9 my original French spec Mac Mini reverts to French Keyboard input source when I close down, even after resetting keyboard input source to British PC on the login screen when booting up. Is there a more permanent setting option stored elsewhere?

    Hi Brendan,
    Thanks for the link. I did go into system preferences and checked that British was the default setting. In fact it was the only setting. Have subsequently done a bit more research. Up to now I have been changing input source at the initial login screen from French to British. I have just typed my username and password in using a French keyboard layout without changing the input source from French. It gets me in and the default input source is showing as British, which it is picking up from the system preferences. So there must be a setting somewhere that is specific to the login screen.
    Done some more searching online and it looks like it may be a bug!
    https://discussions.apple.com/message/23769843#23769843
    There seem to be a few workarounds https://discussions.apple.com/thread/5485931
    However, I have not worked at this level on a Mac before having a background in Windows support, Only recently getting a Mac. The last comment looks like some kind of Unix stuff, which I know OSX is based on.  Is there an idiots step by step guide anywhere to carry out the plist edit etc?

Maybe you are looking for

  • Prompt for a username/password while accessing a resource in wls 6.0

    Hi all, I want to restrict access to any resource on my weblogic server 6.0 and prompt for a user name and password before accessing any resource. I did this using weblogicurl.policy file in wls 5.1. I am not able to find out how to do this in 6.0. C

  • Problems with nls_language

    Hi, people! When I change the NLS_LANGUAGE registry key from US7ASCII to WE8ISO8859P1 Discoverer shows 2 folders with the same name, (one is uppercase and the other is lowercase). The folders' contents are different from each other. Any ideas? Thank

  • Shared calendars are working, but have suddenly started prompting for login info of user who shared the calendar

    My boss started having this problem this morning. It may possibly be due to an update. The calendars appear to still be working fine (not 100% sure they're getting new updates) and I've tried deleting them and re-adding them and the problem persists.

  • App Error 5232

    i have a pearl flip and when i turn it on there is a white screen and the error message shows up.  i don't care about the back up, i just want the error gone, please help

  • How to disable/remove unwanted language templates in ISE 1.1.1

    We're using ISE's Sponsor/Guest Portal function. We customized the english default lanuage template. But we do not want to translate/customize all default language templates. How can I disable/remove the unwanted templates? (The delete button is disa