How to capture keystrokes from LIRC dongle

Hello,
Newbe here so be gentle.
I want to capture keystrokes send out by the LIRC dongle. I made a script file which runs correctly when I run it from the command line. But it doesn't seem to work when ir runs as a service.
Basically, what I've done is this:
#!/bin/bash
while true
do
read -n 1 ir_code
case $ir_code in
"W")
echo "... inschakelen"
echo 1 > /sys/class/gpio/gpio200/value
sleep 2
echo 1 > /sys/class/gpio/gpio91/value
"Z")
echo "Uitschakelen ..."
echo 0 > /sys/class/gpio/gpio91/value
sleep 2
echo 0 > /sys/class/gpio/gpio200/value
esac
done
Is there a reason why this won't work as a service?

1. Read the section of the Swing tutorial (linked from the topic listing page for this forum) that deals with Key Bindings.
2. If you still need an application-wide listener, go through camickr's [Global Event Listeners|http://tips4java.wordpress.com/2009/08/30/global-event-listeners/].
db

Similar Messages

  • Capture keystroke from the SAP Business One Desktop

    Does anyone know how I can capture a keystroke from the SAP Business One “Desktop” with the UI API?
    Basically, open the B1 Client, then click the mouse in the back ground beside the main menu so that the cursor is “nowhere” (not in the search field). Now set some code In the KeyDown event to catch any keystrokes. Nothing happens. The event is not called. I even tried using SetWindowsHookEx API function but never got it to work with an SDK project since there is no form hHandle. Woudlnd even work once I gave the hhandle of the B1 Client

    Hi Marc,
    what is your exact requirement ?
    I don't think you can specificly catch a key down in the background - but only because it is not possible to "lose" main menu as active form ( only if you close it -> then search field is active ).
    So basically you have to find a logic where you can catch *your* keydown on any form.
    Be aware of the fact, that keydown won't let you catch all keys / key combinations.
    I had an equal requirement some time ago and after a lot of experimenting ( windows global hook wouldn't work reliable ) I ended up using SBO key shortcuts ( F2-F12 ) and their menu events.
    regards,
    Maik

  • How to capture images from stageVideo container

    Hi,
    I am developing video conference application in flash with FMS4.5 and integrating StageVideo API for rendering video on hardware and it's working very nice but, I am not able to capture picture from StageVideo so If anybody have any idea/suggestions about capture picture from StageVideo then your suggestion will help more.
    Thanks
    Ram

    Hi,
    Thanks for your interest in StageVideo. The following resources might be useful:
    http://help.adobe.com/en_US/as3/dev/WSe9ecd9e6b89aefd2-68d5ef8f12cc8511f6c-8000.html
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/media/StageVideo. html
    http://everythingfla.com/quickies/stageVideo
    http://www.adobe.com/devnet/devices/articles/video_content_tv.html
    Thank you !

  • Hi, I would like to ask about how to capture data from real time loop.

    Hi,
    Here is some overvier of my project:
    I have done real time control using labview 9.0. I used PID controller.
    In order to optimise this controller, I need to capture data from my sensor(input) and actuator (output).
    1. For example while real time control is running. I need to capture 1000 sample data (sensor(input) and actuator (output)).
    Then I will used these data for PID optimisation on the other loop without intefere my real time loop.
    2. When PID optimisation is completed, I will sent its PID parameter to real time control loop.
    3. These operation is done in parallel.
    Anybody can help me to solve these. Your idea may solve my problem.
    TQ

    Typically you will have to use RT FIFO or Queue communication to avoid any impact to your time critical loop.
    Best regards
    Christian

  • Capturing keystrokes from other programs

    Hi,
    I'm looking for away to to capture mouse and keyboard events from programs other than my java program. I want my program to log and analyse mouse and keyboard events from any program that is open in windows. I'm designing a user interface analyser. Can anyone help?
    Cheers!
    Jacques

    Thanks for all your input, but I am sadly no closer to
    an answer :-( It looks like its going to have to be VB
    unless someone can save my life and help me out in
    Java. Please keep posting and hopefully someone might
    give me that elusive solution.VB won't do this either. What you are asking about is injecting a system wide hook into the operating system. I can pretty much guarantee that this will not be possible without resorting to native code.
    If you are on a Win32 box, the system hook you are looking for is (duh) the keyboard hook. To get it to work across processes, you have to prepare a DLL that contains the hook procedure, then register the hook procedure (and the DLL hmodule) with the Windows hooking system. After that, every time an application is loaded, Windows will also load your DLL, and will forward key press events through your hook procedure.
    Setting global hooks like this is a tricky business, and I wouldn't recommend it as a first program.
    You can do a Google search on "Windows Global Keyboard Hook" and find info on how to do this. If you want to do it using only Java, then you are out of luck.
    - K

  • How to capture events from vbs script in java

    Hello all
    i have vbs script that executing some actions after its done running or after its fails the vbs script
    returns string , my question is how can i execute this script but also capture in java the returned string from the vbs script
    Thanks

    Hello
    nop im talking about java here is what i got untill now .. ( not working )
    for example say i have vbscript that do only that :
    myVbs.vbs :
    set WshShell = WScript.CreateObject("WScript.Shell")
    WScript.Echo "Hello World!" and i like to capture this "Hello World!" string in my java code how can it be done?
    this is my java code , but its does not working ..
    public class ExcVbs {
         public static void main(String args[]) throws InterruptedException{
              Process p = null;
              try {
                   p = Runtime.getRuntime().exec( "rundll32 url.dll,FileProtocolHandler myVbs.vbs" );
              } catch (IOException e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
              p.waitFor();
              OutputStream pus = p.getOutputStream();
              System.out.println(pus.toString());
              System.out.println( "Code=" + p.exitValue() );
    }

  • How to capture screenvideo from ipad 2?

    Hi, I is making a presention and I want to capture a screenvideo from my ipad 2 into the presention, howto?

    Front I'd say you can't without affecting how the digitizer is going to work, and as for the back .... why bother?
    If you want to mitigate further damage, then consider something like ZAGG shields, which provide coverage for both sides, or better cases, or some combination of the two.

  • How to capture record from grid

    hi have written this piece of code to caputure record from a grid onto my editbox(Code)
    If FormUID = "CQ_SubForm" And pVal.ItemUID = "3" And _
                pVal.EventType = SAPbouiCOM.BoEventTypes.et_DOUBLE_CLICK And pVal.BeforeAction = True Then
                    oDBDataSource.SetValue("Code", 0, ogrid.DataTable.GetValue(0, 0))
                End If
    but this code is getting only one value everytime....i want to capture only that data which is clicked....
    how to solve this prob?

    Hi,
    try this code
    if (ogrid.Rows.SelectedRows.Count > 0)
                                                          i = ogrid.Rows.SelectedRows.Item(0, SAPbouiCOM.BoOrderType.ot_SelectionOrder);
                                                          otxtvalue= ogrid.DataTable.GetValue(0, i).ToString() ;

  • GP - CAF : How to capture data from impersonalized form.

    Hi All,
              I have a requirement where in I have submit the data offline using an Adobe form and this data should be fed to an RFC any no if times.
    I have created a interactive callable object (Impersonalized form) using a form template. I'm able to download the form and submit any no of times.
    But the problem I have here is: I do not see any way to capture the data from the form and input it to the RFC. Please let me know if any of you have any ideas.
    Version: Netweaver 2004s SP15
    Thank you,
    Vasu Mullapudi

    I got the solution.
    GP Process in design mode have a tab Forms. Here, we can add the Interactive form callable object (Impersonalised form) and can map the fields to the process context.
    Thats it. Whenever you submit the form, the process is run with the form data and the job is done.
    Note: If the data is not sent to the process, try from the callable object in design mode -> Configuration tab.
    Here while selecting the Start process Upon completion, you have a option for mapping fields.
    Thank you,
    Vasu

  • How to capture image from USB camera in Labview 2010

    Hey all,
    I am very new to Labview but am working on a project that requires me to use a sensor to send a signal to Labview to capture an image from a USB camera and save.  Then apply some image processing to do some geometric calculations.  The calculation will be based on pixels so I guess the image needs to be in bitmap form.  Right now I am just trying to start with the image acquisition part and was wondering if this can be done in Labview 2010.  I have the vision toolbox and NXT Robotics.  Are there any examples on this website that will help and do I have te proper tools to do this?  Once I get the image capture/grab to work using labview, then I could work getting a sensor signal to trigger that capture and finally the processing side. 
    Like I said, I am very new to this so I am not sure if I need to download any particular drivers or vi's that I am missing or what those might be.  Can someone provide some insight, links, or any help would be appreciated.
    Thanks in advance for any help/suggestions.

    Hi wklove,
    In order to do vision with LabVIEW you need to to have the Vision development module and have NI Vision Acquisition Software (VAS) installed. It sounds like you are missing VAS you can download it here. Once you have this installed you should be able to see your camera in Measurement and Automation (MAX). After you are able to see the camera, take a look at the NI Example Finder by going to Help » Find Examples
    Joe Daily
    National Instruments
    Applications Engineer
    may the G be with you ....

  • How to capture MessageID from UDF ?

    Hi,
    I would like to get the messageid from UDF (Mapping). Please advise me how to do that ?
    Thank you and Best Regards
    Fernand

    Hi,
    String MSGID;
    MSGID=(String)(container.getTransformationParameters()).get(StreamTransformationConstants.MESSAGE_ID);
    return MSGID;
    Regards,
    Yaghya
    Just create a new simple user defined function with no input parameters and add the above code.  Then you can use the function to map to any other node
    Edited by: Yaghya Nana on Jun 2, 2008 11:36 AM

  • How to capture content from respone

    I want to capture content form response, and dont display in page.
    RequestDispatcher rd = req.getRequestDispatcher(uri);
    CapturedServletResponse resp2 = new CapturedServletResponse(resp);
    rd.include(req, resp2);
    String content = resp2.getOutput();
    The code is ok in tomcat, but dont get everything from content and display the content to jsp page in weblogic 11g.
    Can anybody suggest an solution or point me in the right direction to solve this issue?
    Thank you

    Hi Panya,
    There is a feature called "Proof Of Play" which was created exactly to track what the DMPs are playing, you can find the documentation at the following link:
    http://www.cisco.com/en/US/docs/video/digital_media_systems/5_x/5_2/dmm/user/guide/signs/proof.html
    Is this what you are looking for?
    Best Regards,
    Marco

  • How to capture output from Runtime.exec() ?

    Hi,
    Well, the question is in the subject ...
    I'd like to capture the output of a process ran by Runtime.exec() in order to process it.
    thanks,
    ionel

    Okay ...
    Sorry for the post !
    I found the solution : Runtime.exec().getOutputStream()
    Thanks however
    ionel

  • How to Capture Value from Form in DFF at Data Entry Level

    I need to catch some Atrribute into DFF, which are stored in Customer Master DFF to Order Entry Form DFF, when that Particular Customer is selected.
    For e.g. If in DFF of Customer Master Attribute1 is 'XYZ' for ABC Customer.
    When user is booking Order For that Customer, Order Heaer DFF should be polulated by 'XYZ'.

    Use NAME_IN function to get value.

  • How to capture Sony Hvr Z7 m2t Files FCPX 10.1.1

    Can any one help me there.
    I have a Sony Hvr Z7 - I can capture it with log and transfer with FCP7 or convert it with many programs out there. But
    I wanto to know how to capture straight from the Memory Recording Unit  connected by fire wire.
    Any Help there would much preciated
    Thanks

    First of all thanks for your answering. I know that.  But somewhere I came acros a way to do it
    but I have lost the link of it. I know, or think I know, there is a way. Kind a of archive or something like that.
    What I remember is that I had to import all the cf at once - and not been able to import file by file.
    I'll keep looking for it. If I find I'll post it here.
    Thanks any way!

Maybe you are looking for