Capture system-wide keypresses in c/c++, what library to use?

I want to be able to capture system-wide keypresses with a JAVA application in OSX. As this is not possible using pure java, I need to write a C/C++ app that does the listening, and combine that with my java app using JNI.
But that is not my problem
I was looking at this great tutorial:
http://ubuntuforums.org/showthread.php?t=864566
It does what I want, but for linux, and uses the X11 library's for the actual keypressdetection.
As I don't know much about C/C++ for OSX specificly, my question is, what would be a good library for replacing X11 with (preferably something that everyone already has, like X11 in linux). I know I could use SDL or something for this, but isn't there anything a little closer to the system that everybody has by default?
Thanks
Reinout

It would be best if you post this question on the Real Time forums since you are working with RT.
Applications Engineer
National Instruments

Similar Messages

  • What library to use? [SOLVED]

    I want to write a program that involves some fancy effects (like the kind in a dock such as awn or compiz) and I want to know what library to use - even better what library they use.
    Last edited by Lexion (2009-11-25 20:59:43)

    Well, cairo-dock has some pretty nice effects, and it uses (surprisingly) the cairo libraries.  There are some binary packages of cairo libraries for ruby and python too, if you're planning on using either of those languages, it might be worth having a look at.  I'm not sure how easy they are to use (never personally wrote a program using them), but it should fulfill your requirements.
    Hope that helps,
    Lswest

  • Capturing system-wide key events

    I am writing a pseudo-wordprocessor, and have a StatusBar class that is (supposed) to show the user their status... e.g. whether Insert or Caps Lock are enabled. To do that, I obviously need to check whether those keys are pressed.
    However, I don't know exactly how to perform such a check. I assume it has something to do with a system-wide KeyListener, but how would I implement that?

    see this code
    I hope i've understand you!!!
    bye,
    leo
    import java.awt.event.*;
    import javax.swing.*;
    public class CaputreKey extends JFrame {
    JLabel txt = new JLabel();
    public CaputreKey() {
    txt.setBounds(10, 20, 100, 100);
    this.setBounds(10, 10, 300, 300);
    this.getContentPane().setLayout(null);
    this.addKeyListener(new java.awt.event.KeyAdapter() {
    public void keyPressed(KeyEvent e) {
    all_keyPressed(e);
    this.getContentPane().add(txt, null);
    public void all_keyPressed(KeyEvent e) {
    if (e.getKeyCode() == e.VK_CAPS_LOCK)
    txt.setText("CAPS");
    else if (e.getKeyCode() == e.VK_INSERT)
    txt.setText("INSERT");
    else
    txt.setText("OTHER");
    public static void main(String[] args) {
    CaputreKey caputreKey1 = new CaputreKey();
    caputreKey1.show();
    }

  • How can I tell what library is used for readdir?

    I have a problem that a program responds differently on two different unix machines, both of which are running Solaris 2.6, and using the same C compiler (4.2)
    "readdir" returns a "struct dirent" where the d_name is offset by two bytes on one of the machines.
    I have used ldd to detemine the libraries to which it is linked, and although they are linked in a different order, the libraries on each machine are byte identical. I have also proved that the program includes the same dirent.h file on both machines.
    Dumping information from the libraries shows that there is a readdir function in /usr/lib/libc.so.1 and /usr/ucblib/libucb.so.1.
    My assumption is that the header files give the same offset into the structure, but that one of the libraries is returning a differently constructed structure.
    How can I find out if the program is calling the same one at run time?
    Thanks for any help you can give.

    I am reasonably sure that the lib that appears first in the ldd output is the
    lib that is supplying the routine. One way to make sure is to use dbx to
    set a breakpoint in readdir. If there are multiple copies of the readdir
    symbol, which there should be in this case, it will prompt you with a list
    of shared libraries that have the symbol and ask which one you want to
    stop in. Pick one, then run your program. It will either hit the breakpoint,
    in which case it is satisfying the symbol from the lib that you picked, or
    it will not hit the breakpoint, in which case it is not getting it from that lib.
    Delete the first breakpoint, then set another breakpoint in the same routine
    and tell it to stop in the other lib. The fact that it stopped in the first lib
    means that it's not likely to stop in the second lib, but there are ways for
    it to hit both or neither. Check them both.

  • W2K8 & Win7 - Setting system-wide Trusted file locations not working

    Win 2008 Network, Win 7 workstations.
    RE: Setting system-wide trusted file locations
    I have an application using Flash stored on a network location that accesses other files in the same location.  This causes the security warning "The following local application... is trying to communicate with this internet-enabled..."  I can add the location to the trusted sites in the Setting Manager and the warning goes away.  It is not practical however to do this on every machine on the network.  I have tried the FlashPlayerTrust directory and mms.cfg file and neither of these seem to work.  Is there a trick to getting the FlashPlayerTrust directory to work properly.  If I could get this working, I could create a script that copies this file to all machines on the network. 
    Any help you be greatly appreciated. 

    Hi Todd,
    Can you please provide just a little more detail?
    * When you say "accessess", what API is being used?  Are the paths to the other files relative, file: URI http: URI, other?
    * In the FlashPlayerTrust directory, are you using the same path notation as appears in the Settings Manager?  What's a sample {filename}.{ext} being used?
    Thanks!
    -Erica

  • System-Wide Formatting not applied to Dashboard Column Prompt in 11g

    In OBIEE 11g, I have a dashboard column prompt with a date column. I use this column in the analysis and have made the column properties (formatting) a system-wide default for that column.
    When I use the column in a dashboard column prompt, it does not show this formatting.
    Any ideas why it might not work?

    So from what I understand about your question, the system wide default data format you have set for the date column is not following the same format when you use it as a dashboard column prompt. The system wide format only applies for analysis purposes and not for prompts in 11g.
    Regards,
    -Amith.

  • What RapidMart is using to connect SAP R/3?

    Hi, We used Data services for mostly OLTP system and now we are thinking of using it for SAP R/3 system. I read that the most efficient method for large amount of data is to use SAP ABAP call using SAP R/3 Data flow. We can create ABAP program from DS and load in SAP system. We want to know what rapidmarts are using. I don't think rapidmart is using ABAP method to connect SAP R/3 and get data.
    Can someone clarify?
    Thanks,

    I got no reply so closing this thread.

  • Mapping code to a system wide event (keypress)

    I wanted to know if it was possible to have a java program run a procedure based on a system wide keyboard event (say a funtion key was pressed). For instance if someone were in a word processor they would hit the "F1" key on their keyboard and that would cause something to happen on the Java app running in the background, say past some text or something from the java app into the word processor through clipboard.
    Thanks in advance.

    to the best of my knowledge the only way to do this is to have a native application that can then invoke the java program. You will need to look into JNI (Java Native Interface).

  • File Type Associations Do Not Stick System-Wide CS4

    When I set File Type Associations for PSD, Tiff, DNG and Jpeg fles in Bridge CS4 so that my files will open in PS CS3 (and insure that the same file associations apply in Bridge CS3), this works as it should from within CS4 and CS3, but it is impossible to introduce a system-wide change in Mac OS 10.5.5 via File-Info. It always reverts to CS4 for these file types, if I try to 'modify all'. The same thing happened when I upgraded from CS2 to CS3.

    If File Type Associations are set properly in the Bridge preferences, the default setting can be made to open files in PS CS3, with CS4 installed. This works from within CS3 and CS4. However, it sometimes happens that one is in the Finder, and the default remains PS CS4, however much one tries (via File-Get Info) to modify the default system-wide settings so that these files open in CS3. In any event, a bit invasive. Of course, if I could get comfortable with the Adjustment Layer Panels, all this would be unnecessary, but for the moment, there appear to be too many clicks, and it is going to take some time, so I don't want to burn bridges. Perhaps there is also some ambiguity in my mind as to what the pointing finger in the new Curves dialogue box, much like a tolling bell, is trying to tell me.
    But thanks, once again Anne, for your good-natured help.

  • Captivate 7 is not capturing system audio, and the software has a broken link

    The Problem:
    Captivate 7 is not capturing system audio. When I start a screen recording, the line with "System Audio" and its checkbox are eternally grayed out. Next to the grayed out words is a link that says, "Why is this disabled?"
    The lnik goes to:  http://www.adobe.com/go/cpaudio
    Which is not a valid link, so Adobe's site redirects me to blogs.adoble.com/captivate which is ZERO help. Both browsing and the search bar bring no answers.
    The Device:
    Apple Macbook Air, Mid 2013, running OSX 10.9.2.
    What I've done already:
    Obvsiously I have set Captivate 7's preferences to capture system audio, and have set System Settings -> Security and Privacy -> Privacy -> Accessibility to allow Captivate to control my computer.
    I have also tried clicking the Mic icon, Selecting Source with the System Audio icon and that doesn't record system audio either. It acts like it is recording system audio, but when I stop recording I get a popup that says, "Cannot record system audio. Ensure that you are playing audio on your computer [Okay]"

    It's a wierd one.
    One thing to try, and this fixes a lot of things, trash your preferences.
    http://www.digitalrebellion.com/prefman/
    DM

  • Unable to save column as system wide default

    Hi All,
    I am in 11.1.1.1.6, I am trying to the save a column as system wide default in 11g but my changes are not getting saved or reflected?
    This is what I did using the "weblogic" user name and password
    1. Pulled a column EmpName in the criteria
    2. Added an action link to that column, which points to another dashboard page Page1
    3. Saved as system wide default by clicking on save as system wide default for "EmpName"
    4. Restarted the presentation services.
    Now when again logged in, and selected that column in my request, what I expect to see (when I run the request and go to results) is that navigtion applied on this column which will take me to the dashboard page Page1.
    But this is not happening, What is that I am missing? Can anybody please let me know
    Thanks,
    Ronny

    Thanks Deva for your reply, I don't have access to Oracle support, I'll have to go back to my client saying that this is a bug,
    Can you please confirm that this bug which you mentioned is related to not being able to save the column properties as system wide default in obiee 11.1.1.1.6.0 version?
    Also what i just found online is that this bug was fixed in 11.1.1.1.6.2? Can you please confirm this?
    Thanks,
    Ronny

  • Using /etc/bash.bashrc to set system-wide alias

    Hi,
    I would like to set some system-side aliases and from what I read /etc/bash.bashrc is the correct place to put them.
    However, it seems that the root account doesn't load this file. 
    What is the correct way to define system-wide aliases?
    Thanks.

    To be more specific, the aliases are not visible when I use a login shell i.e. 'su -'.
    According this explanation http://stefaanlippens.net/bashrc_and_others this is correct. 
    So, do I need to duplicate the aliases in /etc/profile so they are visible from login shells?  Or there is a way to define system-wide aliases for
    login and non-login shells?
    Thx.

  • EEW customizing for system-wide object extension

    Hello.
    We are trying to enhance BUPA object through easy enhancement tool. We
    customized EEW via EEWC transaction and we created a RFC connection to
    let central system (CRM) and target system (R/3 system) to communicate
    each other.
    After these steps we launch EEWB transaction from CRM system by doing
    the following steps:
    1.We created a new project
    2.We created a new extension for BUPA object, and type of
    extension: “Add new fields”
    3.At this moment Wizard is started.
    4.We enter the name, enter the technical properties .
    The problem appears when we try to enter SYSTEM RELEVANCE, we can´t
    state in which other systems the fields of the CI Include are relevant
    because only column “Relevant for BW” appears, and we want
    enter “Relevant for R/3”. However the transport requests are created
    system-wide what shows that the two systems are communicated.
    Nevertheless, no objects are extended in the target system although the
    extension is executed properly in CRM.
    Could you please tell us what is due to?
    Thanks in advance

    Carmen,
    Have you defined the R/3 system landscape in transaction EEWC.  In order to define a field as R/3 relevant the corresponding R/3 systems need to be defined in the EEWC setup.  However EEWB does not work with R/3 backends lower than 4.7 from past experience.  If the R/3 system does not have the packages or function groups that start with OXT.   You must have at least 4.7 or higher in order to use the auto-generation features for R/3.
    You must also make sure you perform the post-processing steps described in the EEWB documentation(in the standard CRM help) in order to make sure the processing fully works.
    Good luck,
    Stephen

  • Set system-wide Finder view preferences

    I know that .DS_Store files are created in every directory I enter with the finder in Mac OS X, and that keeps track of the folder's metadata (including how is it being displayed). I also know that this command:
    sudo find /Users/[USERNAME]/ -name ".DS_Store" -depth -exec rm -f {} \;
    ... will recursively delete all .DS_Store files insite the /Users/[USERNAME]/ folder.
    Also, I know that when pressing CMD+J inside a finder window, selecting the configuration I want (40x40 icons, small-medium grid space, arrange by kind, text size 10px, show item info, show icon preview, background white) and selecting "use as defaults" will.. well, make it the default, and holding OPT will restore it to THAT default.
    The thing is that, when I create a new folder, it doesn't take those parameters. And the folders that HAD .DS_Store files deleted keep that previous configuration, not the "default" one.
    What can I do to set a system-wide, consistent finder look?
    I'm on Mac OS X 10.6.6.

    Hi,
    I think I remember a similar problem in Tiger yonks ago. I recall the solution was to make all the changes to the Finder whilst in an Admin account - this way the choices stick for all windows?
    Worth a shot.
    S.

  • Capturing System Date in Calculation

    Hi,I am in need of urgent help. Can i capture system date in Essbase to perform calculation. If possible what is the procedure else what is the work-around method. Thanks----Ayan

    Not sure what you are asking. Can you give an example?

Maybe you are looking for