OnKeyPress event -- How to do?

Hello, I'm trying to figure out how to make a function that knows when a certain key has been pressed (F5, perhaps) and if it has, does something.
I've pretty much found out how to do this from a GUI, but seeing as it's console based I don't know. From what I read you need to set the component to have Focus.
I don't want that, I want this to, when ever it's running, do something everytime I hit a specific key whether the window is opened or closed.
Thanks for the help that anyone can give me :D
edit: I'd just like to note this isn't for malicious use. I don't even think it's possible to write key loggers in Java.
Edited by: Maver on Nov 13, 2007 10:52 AM

Hi Frank,
Thanks for the reply.. When i dropped a text box into the JSPX page and checked its properties, it had onKeyUp, onKeyPress, etc.. So i thought i could possibly use them.. I'll do it the Servlet way then. Thank you.. :)
Pravin

Similar Messages

  • Embeded Flash Object and onkeypress event

    In a jsp page,
    <body onkeypress="javascript:keyPress(event);"...
    //some codes to embed the Flash object
    1) If the focus is on other part of the document, not on the
    embeded Flash object, the Contrl + Enter key stroke will trigger
    the onkeypress event;
    2)But, if I click on the embeded Flash object (not the Flash
    Object has the focus), the Contrl + Enter key stroke will NOT
    trigger the onkeypress event;
    How to solve this issue (#2)?
    Thanks
    Scott

    Ok, I've found the thread describing the problem.
    http://www.adobe.com/cfusion/webforums/forum/messageview.cfm?forumid=75&catid=697&threadid =1342621&enterthread=y

  • How to change behavior of Select tag onKeyPress event

    I am populating a netui:select dropdown with a list of around 1200 items. Since it is so long, I would like to allow the user to type in the box to get close to their selection. Right now, the default behavior is to allow only one character to be typed to locate an item.
    I would like to change the behavior so that when the user quickly types three characters (or more), it matches the selection to the three that they typed. It seems to be firing on the onKeyPress event. Is there anyway to modify this?

    Hii,
    I am unable to understand exactly wat you want.
    But for free amount of lines : Keep that text under LOOP. Right click on template or window and create a loop and under that loop keep the text ,you can get many lines. or the given below point plzz follow.
    1,Use SO10 Tcode to write standard text in Smartform.
    2.For long text
    method1
    Create TEXT node- general attributes change text type to include text
    then you can input text name/text object/text id/language
    method2
    create PROGRAM LINE node - use FM READ_TEXT to read it to a internal table
    then use LOOP or TABLE node to display it
    For TEXT module(For foreign language)
    Tr-code:smartforms -- choose Text module(not choose form)--create a text module object
    then enter smartform Create TEXT node- general attributes change text type to text module
    input the text module name which created by above
    3.
    1. take function module name of the smartform.
    2. goto se37 and type that fm name.
    3. goto attributes tab
    4. double click on either program or include .
    5. There u can find all the subroutines used inside smartform.
    6. search for "perform %move using %textkey-name".
    4.Standard Texts are created in SO10 Tcode and stored in STXH table with OBject ,ID and NAME parameters. We can use Read_Text FM to read the text.
    check the tables STXH & STXL.
    5.
    How to CAll Standard Text in Smart Forms
    In SFs you can insert the standard tests using the TEXT node. Create a TEXT NODE. Then in the GENERAL ATTRIBUTES of this TEXT node select INCLUDE TEXT in the TYPE option. Then you have to enter the text name, object , ID and language in the provided fields. Then if you dont want any error if there is no text in the corresponding text then CHECK the check box "No errors if no text available.

  • How to submit commandLink using onkeypress event?

    Hi all,
    I have problem in submitting a commandLink using onkeypress event.
    Assume a <h:inputText/> along with a cmdLink for searching by key
    words.I tried the following code inorder to submit cmdLink.
    My Code :
    <script>
    function setClick(event)
         var key;
         if(window.event)
         key = window.event.keyCode;
         else
         key = event.which;
         if(key==13)
                             document.forms['SummaryForm']['SummaryForm:_idcl'].value='SummaryForm:asinFilterSubmit'; document.forms['SummaryForm'].submit(); return false;
    </script>
    <h:inputText id="asinFilter"
              value="#{inventoryVisualBean.inventoryPageBean.asinFilter}"
                                       onkeypress="setClick(event)"/>
    <h:commandLink id="asinFilterSubmit" action="#{inventoryVisualBean.search}">
    </h:commandLink>          
    so the above code will perform the search by keyword while pressing enter
    key,its working well in IE browser,but in mozilla browser the input field
    always retains the first character of keywords while selecting a keyword using keyboard and hitting enter key.
    i.e:
    v
    vocab
    vive
    are the keywords,if choose vocab keyword using keyboard and hit enter key,the search results are produced only for the character ' v ' not for ' vocab ' because the input keyword ' vocab ' gets changed as ' v ' in the input text
    while pressing enter,its working fine in IE.
    can any one help me out?
    Pls dont suggest onkeyup instead of onkeypress as i my requirement does not allow it.
    Thanks in advance,
    sundar.

    This would work with plain html and javascript:
    http://www.galileocomputing.de/openbook/javascript/javascript15.htm : Chapter 15.1.5.
    The handleevent javascript method can be used to redirect events.
    Maybe you can pretty much use the same with JSF. You have to getElementById, deriving the link element, and call the handlevevent method on it. Give it a try :)

  • How can I disable the "Events" how can I disable "Faces"

    buona sera
    how can I disable the "Events"
    how can I disable "Faces"
    grazie

    You can not
    Events are one of many views or your photos in your library - as are faces
    YOu can simply ignore both but you can disable them
    LN

  • In iPhoto, I want to copy certain photos in an event and then have the copies in another event WITHOUT removing the original photos from their original event; how to do that?

    in iPhoto, I want to copy certain photos in an event and then have the copies in another event WITHOUT removing the original photos from their original event; how to do that?

    The only way to do that is to export the image to a new file and then re-import it.
    It's not really the intended way of working as it uses twice the disk space and is inefficient.
    Use Albums instead. A Photo can be in any number of albums and use no extra disk space as it just simply references the image in the Library. Albums can be sorted any way you want - including manaually - and can have image from anywhere in the Library just by drag and drop.

  • Imported old family video, I seperated different events, how can I save event to put together in a menu like family, vacation, christmas.

    Imported old family video, I seperated different events and named each event, how can I save event to put together in a menu like family, vacation, christmas to make a DVD

    revdhayes wrote:
    I imported 5 1 hour old video in Final Cut Pro X. I spent all day seperating clips with Start and end then naming each clip in properties..
    Sorry, but I don't understand  what "5 1 hour video" means.
    I do understand that you have a lot of clips that you want to group by various subjects, like vacation, etc. That's a perfect job for keywords, which perhaps is what you used when you named them?
    If you did use keywords, go to that TL Index and click Tag at the top and then the keyword icon at the bottom. It should give you a list of only clips in that category. Select clip from the menu and it should highlight them. You could then copy and paste them to a new project for export. Repeat as necessary.
    If you're going to do a lot of these, I'd suggest doing this from the event browser, applying keywords and then the clips into separate projects.  But there are always more than one way to do things, and to each his/her own.
    Again, I don't have any idea how long your footage is and whether it is even possible (or desirable) to fit it on to a single DVD. I mentioned iDVD because of its menu and sub menu capabilities. You will need another app like Compressor to do the chapter makers (unless Apple updates FCP before you finish your project and adds that capability. That would be nice,)
    Good luck.
    Russ

  • Mouse events: how to know its button1 or 2 or 3?

    writing a program that's driven by mouseReleased event. how do i determine that the user clicked the 1st mouse button n not the other mouse buttons? please help! thanx! :)

    also, for double-click:
    if(mouseEvent.getButton() == mouseEvent.BUTTON1){
    if(mouseEvent.getClickCount() == 2) {                                                                                                                                                                                                                                                        

  • 11g: Contextual Events - How do I fire them on currency change?

    Hi!
    After posting a question here: 11g: Bounded task flows, need help and advice!
    I read the article at http://technology.amis.nl/blog/3365/adf-11g-how-events-in-one-region-cause-other-regions-to-refresh because I need to refresh region B when the user selects in region A.
    Now, the comments in that article suggest that Contextual Events are the built-in mechanism for that use case. So I tried that first. The online help suggests that this is what I need.
    I read the online help and created an event and defined a producer and consumer in the event map in the parent page's page def. Now the help shows how to fire the event when a methodAction binding is executed. But I need to fire the event when the user selects a row in region A's table.
    1. How do I do that? Where do I put the event? The help says it's possible, but does not show how. Add a selection listener to the backing bean and call the event-enabled methodAction binding from there? Or is there a better way?
    2. I get the impression, that - when I use the event to call the consumer's binding ExecuteWithParams method - just the query of the consumer's VO is executed. That's great. But how do I reset the flow to the initial action? Just refreshing the VO is not enough. I need to reset the flow to the initial action (showing a view).
    I read http://www.oracle.com/technology/products/jdev/tips/fnimphius/taskflow_in_popup/taskflow_in_popup.html and now I am completely confused. Use input parameters or use events? If I use events, how do I reset (refresh) the task flows?
    Thanks,
    Sascha
    Edited by: Sascha Herrmann on Oct 19, 2008 3:33 PM

    Sascha,
    are region A and B share the same transaction ? If yes and the content in region B is a dependency of the VO used in A then you don't need contextual events at all. So if i assume that region A contains a list of departments and region B the employee table (where DepartmentsVO is the parent of EmployeeVO) then you can do as follows
    - navigate to the region definition of region B in the pageDef file
    - use the right mouse context menu to add parameters, and then a parameter (e.g. changeIndicator)
    - wire the changeIndicator parameter to the DepartmentsVOIter current row key str (its a method exposed directly on the iterator)
    - set the region binding refresh to ifNeeded
    - set a partial trigger on the regionB to point to the departmentTable so the region is refreshed whenever the table row currency changes
    The parameter that you added just does nothing except that it indicates to the region binding that the region must refresh. You point it to the row row key of the department iterator because it provides the changed value.
    If VO in regionB is not dependent on the DepartmentVO, then you need to create a parameter on the bounded taskflow, which takes the value of changeIndicator to write it to pageFlowScope.currRowKey. Then create a set currentRowWithKey method as a default activity and wire it up to pageFlowScope.currRowKey
    Frank

  • Upgraded to ios 7.1 battery drain is significant and have lost my calendar events. how do i get my events back and why am i losing so much power now?

    how do i get my calendar events back and why the power drain after upgrading my operating system to 7.1?

    Thought I'd reply to this seen as no one else has, I am also experiencing very similar problems with my 4s and by the looks of it is it's across all handsets. I've never had any battery issues with my iPhone even 7.0.6 was fine, but since updating to 7.1 the battery is ticking down very fast. I fully charged in the morning and left it in my locker all day at work when I got my hands on it it's gone down to 52% just on its own!!
    I really hope they sort this out fast the irony is 7.1 was supposed to help battery life!

  • I have photos from several cameras of the same event, how do I combine them?

    I have photos from several cameras of the same events.  How can I sort them together, three pics of the same horse from three cameras side by side; I can't move pics from one camera source to another in a folder.

    Languare is critical since it is all we have to communicate with
    Folders in iPhoto do not hold photos - folders hold only other folders or albums
    If you are speaking of events then you simply merge the events (drag one onto another or select two or more and use the merge events command - for the photos to be "side by side" the three camera's time/date setting will have to be identical as photos will be sorted by time/date - if they are not you can correct by selecting the photos in an event (before merging) and using the adjust time and date command or you can make a smart album for the camera and select the photos and use the adjust time and date command
    LN

  • Wait events - how to read it

    Hi frnds,
    As, I'm beginner to performance tuning I dont know
    What action do i need to take?
    I mean how to read the output which I given below.
    this is the output suffering buffer busy waits.
    Could anyone please tell me
    CLASS TOTAL_WAITS TOTAL_TIME
    data block 93303 58711
    unused 0 0
    system undo header 12 232
    undo header 7847 6636
    3rd level bmb 0 0
    save undo header 0 0
    bitmap index block 0 0
    file header block 0 0
    free list 0 0
    undo block 68 207
    segment header 422 399
    extent map 0 0
    2nd level bmb 0 0
    system undo block 0 0
    sort block 0 0
    save undo block 0 0
    1st level bmb 1 17
    bitmap block 0 0
    Thanks, Muhammed Thameem. S

    Hello,
    "Buffer busy waits" is contention for a buffer (representing a specific
    version of a database block) within the Buffer Cache. So, in essence
    it is block contention and thus it is most likely something to do with
    the design of the tables and indexes supporting the application. A
    built-in bottleneck. On indexes, it could be the age-old problem of
    insertions into an index on a column with a monotonically-ascending
    data value (i.e. timestamps or sequence numbers) which tends to cause
    contention on the highest leaf node of the index. On tables, it might
    have to do with many concurrent insertions into a table in a
    freelist-managed tablespace where the table has only one freelist. It
    could also be due to a home-grown implementation of sequence-number
    generators (i.e. small table with one row, one column in which contains
    the "last value" of a sequence, etc) which lots of people use to avoid
    not being "portable across databases" which they think means not using
    Oracle sequences (yadda yadda yadda).
    I'd look for any SQL statement in the "SQL sorted by Elapsed Time"
    section of the AWR report which exhibits high elapsed time but
    relatively low CPU time, indicating a lot of wait time. Of course,
    there are something like 800 possible wait events in current releases
    of Oracle, of which "buffer busy waits" is only one, so this is just
    inference and not a direct causal connection to your problem. But,
    once I find such statements I'd check to see if they are
    accessing/manipulating tables within the CUBS_DATA tablespace, and then
    use "select * from table(dbms_xplan.display_awr('sql-id'))" to
    get the execution plan(s), and then look for something ineffective
    within the execution plan. You might find the script "sqlhistory.sql" helpful
    here as well, to get a "historical perspective" on the execution of the
    SQL statements over time, in case the buffer busy waits peaked at some
    point in the past
    Please refer to:
    http://www.pubbs.net/201003/oracle/51925-understanding-awr-buffer-waits.html
    Also
    http://www.remote-dba.net/oracle_10g_tuning/t_buffer_busy_waits.htm
    kind regards
    Mohamed

  • Dynamically ALV  Titles  Using Events - How To

    Dear All,
    There is a selection screen. Depending upon the selection, there will be output in ALV grid or list. This output doesn't contain any field of selection.
    So the output must be grouped on the basis of selection as their common title.
    Eg. If model and type are in selection screen then output something like
    Model No. 1    Type No. 2
         ALV Grid for Model 1 and Type 2
    Model No. 3    Type No. 4
         ALV Grid for Model 3 and Type 4
    How to use ALV Events to process the data dynamically for the titles as in above case the numbers 1, 2 ,3 & 4 are present in the output table which is passed to ALV for display.
    Thanks & Regards,
    Sapna Modi.

    Hi Sapna
    To set title you can fill a structure of type <b>"LVC_S_LAYO"</b> (the field gridtitle) and use the method <b>"set_frontend_layout"</b>. You can get the current layout structure using the method <b>"get_frontend_layout"</b>.
    To set column headers you can use to get and set the fieldcatalog at any instance of the runtime. For this you can use <b>"set_frontend_fieldcatalog"</b> and <b>"get_frontend_fieldcatalog"</b>. At the field catalog, you can set titles for columns using <i>"coltext", "scrtext_s", "scrtext_m", "scrtext_t"</i> .
    For more information you can refer to the tutorial <a href="https://www.sdn.sap.comhttp://www.sdn.sap.comhttp://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/an%20easy%20reference%20for%20alv%20grid%20control.pdf">"An Easy Reference For ALV Grid Control"</a>.
    *--Serdar
    [email protected]

  • Swap project and event: how to?

    Hi,
    I've started to use iMovie 10 but I can't figure out how to switch views... I can see the "swap project and event" menu item but it's greyed out... this is surprising since Apple depicts the conventional view with projects top and timeline bottom as the first screenshot on the iMovie website...
    Can someone please advise?

    I too was having problems and pushing play did not help.
    However clicking NEW EVENT made it happen.
    Somehow with all my clicking around I lost my original project so I had to start all over again.
    Personally I got along so well with the old iMovie I am having difficulty with this one and I really miss having the window in another monitor

  • Training&Event : How to create "sub"-resources ?

    Hello,
    I have a question from a customer.  They use Training&Event (SAP R/3 4.6c) and they defined training rooms as resources (transaction PSVR).  Problem : They can divide some training rooms into 2 or 3 smaller rooms. For example: Room 1 (40 seats) can be divided into two smaller rooms : 1A (25 seats) and 1B (15 seats).  They also defined those smaller rooms as resources (same level).  Actually, If they reserve room 1A for a business event, room 1 remain available for another business event at the same date.
    Could someone explain me how to customize resources and relations to allow this room structure, and to avoid double resource reservation ?
    Many thanks for your help.
    Philippe

    Hello Sharon,
    Sorry for late reply.
    Thank you for your answer.  It was helpful.  It's now a part of my solution.
    To identify room and sub-room, I create a relationship (A/B230 - is part of/contains)
    between the resources.  With the user-exit SEMIN-RESOC, I implement a new function module to check the occupation.
    I.e. If one sub-room is not available (directly allocate to a business event), I create a new record in table 'occupation' for the main room.  I determine the main room with relations A/B230.
    It works fine.
    Kind regards,
    Philippe

Maybe you are looking for

  • Flash CS6 Pro Help!!!!!!!!!!!!!!!!!!!

    Using Flash Professional CS6, I noticed as I build my game on it, the performance has become sluggish and using it is very slow to respond to commands. Is it that I have to much objects in library?  Too many tween and movie clip effects? I have to us

  • Captivate 1.0 product activation

    Hello, I am installing Captivate 1.0 but I can not activate the product using Internet. Adobe Chat Support asked me to get help on this forum. How can I activate the product to be able to use it more than 30 days? Thank you.

  • Can I upgrade my Photoshop CS to CS5 and adobe bridge?

    I have an old photoshop cs version and want to upgrade to cs5 and bridge, how do I do this? 

  • Schema Selection Extension

    I've created an extension for Oracle SQL Developer that allows you to specify a default schema for a connection. It also provides a drop-down list to select the current schema for your worksheet. I've made the jar-file and source available through ja

  • Question Mark - "The item cannot be found" at top of folders

    When I open any of my desktop folders and my HD, there is a question mark at the top right-hand side. When I click on it, a message saying "The item cannot be found". Any ideas as to what might be causing this? Ohhhh, please don't tell me my HD needs