Allowing the user to only enter single key strokes?

Hi there - I've created a game for my company that requires
the player to hit certain keys on the keyboard at specific times
(in this case, the cursor keys). How can I make it so that pressing
a key allows one single character, rather than a continuous feed of
them?
i.e.: 'e', rather than 'eeeeeee'
Hope this makes some sense! Any help greatly appreciated,
thankyou :)
Jim

Thanks for the reply clbeech!
It's actually a 'Stepmania' style game, where the player
presses the cursor keys as the appear on screen. I'm not sure
exactly what a 'key listener' is - at the moment a hidden movie
clip appears at certain intervals with this code attached:
on (keyPress "<Left>") {
_root.score = _root.score+1;
_root.LEFTYES.gotoAndPlay(2);
_root.HIT.gotoAndPlay(2);
_root.flasher.gotoAndPlay(10);
It's ' _root.score = _root.score+1;' that's changing the
score. I only want a single point added when they press the right
key, but at the moment it's giving them multiple points if they
hold the key down while the movie clip is present.
Hope this makes sense - thanks :)

Similar Messages

  • How do i put a loop round this so the user can only enter a number between

    how do i put a loop round this so that the user can only enter a number between 1 and 3 if a number like 4 is enter it will just say something like retry
    if (CA.trim().equals(ans1)){
    Out = "incorrect";
    else if(CA.trim().equals(ans2)){
    Out = "incorrect";
    else if(CA.trim().equals(ans3)){
    Out = "correct";
    else{
    System.out.println("Enter 1 2 or 3 try doin test again");
    System.out.println(Out);
    byte b[] = Out.getBytes();
    out1.write(b);

    You already know the conditions so here's some pseudocode.
    get input
    while(input is not what I want (between one and three))
            Inform user of improper input and ask for it again
            get new input

  • I created a form with Single Choice fields, 4 days with times listed. But, I want the user to only be able to choose one time, and the time chosen to be unavailable for other users. How do I do this?

    I created a form with Single Choice fields, 4 days with times listed. But, I want the user to only be able to choose one time, and the time chosen to be unavailable for other users. How do I do this? I have 4 blocks of Single Choice fields in order for the summary page to give me each day in the final report. But, I need the user to be able to make a selection of any day and time and that apointment to no longer be available to future users when they log in. Plus, when the user clicks on the time, they are unable to change their mind and choose another time. Here's the link if you want to see what I'm talking about: 2015-2016 Workload Apportionment Review

    I'm afraid not.    It's not rocket science but you need to do some coding. 
    You'll need to find a script (php) and save it to your local site folder.  Then reference the script in your form's action attribute like so.
         <form action="path/form-to-email-script.php" >
    The input fields in your HTML form need to exactly match the script variables. 
    I'm  assuming you're hosted on a Linux server which uses PHP code.  Linux servers are also case sensitive, so upper case names are not the same as lower case names.  It's usually best to use all lower case names in your form and script to avoid confusion.
    Related Links:
    Formm@ailer PHP from DB Masters
    http://dbmasters.net/index.php?id=4
    Tectite
    http://www.tectite.com/formmailpage.php
    If this is all a bit beyond your skill set, look at:
    Wufoo.com (on-line form service)
    http://wufoo.com/
    Nancy O.

  • Hi All,i am currently working on a flex application that will allow the user to change the language

    Hi All,i am currently working on a flex application that will allow the user to change the language within the application from english to Japanese and vice versa. And everything works fine.
    I am using flex 4.5
    We allow the user to save records with english or japanese texts.
    problem
    When the user manually enters Japanese text and tries to save it the record defaults back to the default name (which is in english). But if you copy the entered text and paste it and then save it.It works fine.
    Any idea , why this is happening?
    Please let me know if the question is not clear.
    Looks like there was already a bug
    https://issues.apache.org/jira/browse/FLEX-28894?page=com.atlassian.jira.plugin.system.iss uetabpanels:all-tabpanel
    Not sure why does it say , Resolved .
    -KB
    Message was edited by: bKartik.b

    By Payal integration , you mean paypal button html ? or payment gateway setup etc ? If its a gateway configuration for your site domain then single page for all layout will work , but if you are using button code for all renditions then you would need to create separate pages for all.
    Thanks,
    Sanjit

  • Allow the user to add multiple email addresses in Email ID Field

    In my jsp page, the funtionality i need to enhance is to allow the user to enter multiple email addresses in the "To" field of my Email A friend Task...right now it allows only one email id to be input by the user
    Can anyone suggest me how to achieve it using javascript /jstl
    Thanks in Advance

    one more alternative is u can use : StringTokenizer class.
    Code as follows: I hope this also helps u. But it will be used at server side. not at client side(for client side validations , we are using javascript).
    java.util.StringTokenizer stringTokenizer=new java.util.StringTokenizer(request.getParameter("to"),",");
              String[] list=new String[stringTokenizer.countTokens()+1];
              int i=0;
              while(stringTokenizer.hasMoreTokens()){
                   list=stringTokenizer.nextToken();
                   i++;
    Regards

  • How can I allow multiple users to edit a single shared iCal calendar?

    Is it possible to allow multiple users to edit a single shared iCal calendar? I also want to provide different permissions to those users. Is this possible through .MAC? Is it possible on Mac OSX Server?

    I would like 2 agenda synced through .Mac but it does not work.
    I have 2 computers and 2 laptops. A very simple agenda with 3 calenders. Myself my partner and the office calender. I want to publish my calender and that of my partner. The office calender I would like to sync so that we can change the office calender at any location.
    I set up sync only for iCall and have a .Mac account. When I change anything on any of the calenders in iCall nothing happens on any of my other locations. Even though the locations are registered as synced. I can see the sync wheel turning but at the end of it the calenders are not synced.
    At this moment I fully understand the publish and unpublished calenders but have no clue what so ever what syncing does for iCall. There seems to be no functionality to it. It does not transport any calender info over .Mac. There is no visable check to see what is happening and the process of syncing is not transperent. Lots of my friends go to me for advise on Apple issues but as far as sync wether iCall or Addressbook I always tell them sync does not work and I have no clue why others have it working. I haven't met any people here in Holland either that got in working. I suppose with iCall you have to get third party software to share calenders editable calenders. Really hopeless situation, wish Apple would just have a manual stating what sync can do and what it can not. Hours wasted on this issue trying to get it to work.
    Hope anyone here can help out.

  • Is it possible to allow the user to highlight specific label in the GUI.

    i have an existing GUI tt allows user to key in records of information eg, patient records in a hospital system.
    and display them based on wat the user key in for the patient's id no:
    is it possible to allow the user to highlight label in the GUI.
    Label as in information like Illness:<Red>Cancer<Red>
    for tt customer only.
    and re open the file to have the color still there.
    i serialized my vector of objects into a file, and have the gui to retrieve them upon execution.
    color wise i m lost.
    one solution is to have a corresponding Color attribute to each of my other attribute in all my other classes.
    besides this, any idea how to do it?
    i also did a search on java map..
    couldn't really find sth useful abt it..
    seems like few ppl know how to use it well..
    API doesn't seems to show how i can use it to reach my objective.
    anyway, i hope the user can highlight A attribute of a record and not highlight the entire record..
    tt's why i find it soo cumbersome to have another Color object created for each atttribute.
    eg:
    patientId, patientName, etc.....
    thanks in advance

    Several Swing components understand HTML tags, eg JLabel, which is VERY useful, as in the previous example.
    Are you asking "how do I highlight a field" or "how do I make it remember the color it has"?
    As Color is itself Serializable, why not store your data in a Hashtable not a Vector?

  • UI design - what is the best way to allow the user to set some kind of infusion at varying (non periodic) times?

    I want to allow the user to specify a curve like this:
    Such that some subVI outputs the value A2 when a time variable is within the range R1, A1 when the time variable is within the range R2, and A3 when the time is within the range R3.
    My design looks something like this:
    With error checking that looks like this:
    My question is, is the array based approach optimal? How else could I tackle this?

    I think I can summarize the conversation to this point as an answer to the original question (What is the best way ...) -- before starting to write any code, think carefully about what you want to accomplish, and write it down (otherwise known as "Write the Documentation First").  One of the points of a good User Interface is that it doesn't allow users to "make silly mistakes" -- it leads the user "by the hand", restricting the entries to "legal values" and requiring that entries be made in a logical manner.
    So if you were going to have a list of Infusions to enter, it makes sense to decide on whether to enter Time Intervals (which are always >0) or Times (which, logically) are always in ascending order.  You can (and should) decide which you want (or you could have a control that would let the User decide, but that might be too flexible) and then enforce your "rules".
    Suppose you decided on "Intervals" (which seems, to me, to be more User Friendly).  After the User has entered the intervals (and you've provided a nice plot of Infusion vs Time), you could allow the User to "split" an Interval, "Remove" an Interval, or "Edit the Infusion" of an Interval, or you could decide to have a simpler "Accept or Start Over" choice -- if you only have a few intervals, the last might be the simplest (and thus the Best) Design Choice.
    Spending more time thinking before coding usually pays Big Dividends!
    Bob (speaking from Sad Experience) Schor

  • In ALV Report ,a field to allow the user EDIT/CHANGE

    Hi Guys,
    My requirement is
    in the ALV Grid display iam having 10 fields.5th field should be allow the user EDIT/CHANGE mode.
    what ever he enters the value the same should be updated to an custom table.
    EX.
    o/p:
    0001   0002   0003   0004   0005   0006   0007  0008   0009   0010
    Now the user changed the value 0005 to 0011.
    0001   0002   0003   0004   0011   0006   0007  0008   0009   0010
    now 0011 should be updated in custom table.
    to do this process please suggest a best way for coding.
    thanks in advance.
    Sunil.

    hi
    *& Report  ZTESTDEMO_INTERACTIVE_LIST_2
    REPORT  ZTESTDEMO_INTERACTIVE_LIST_2.
    TABLES: MARA,MARC,MARD.
    * internal table itab_mara 3 fields matnr, ernam,mtart
    DATA: BEGIN OF ITAB_MARA OCCURS 0,
    MATNR LIKE MARA-MATNR,  " material number
    ERNAM LIKE MARA-ERNAM,  " name of person who create
    MTART LIKE MARA-MTART,  " Material Type
    END OF ITAB_MARA.
    * internal table itab_marc 3 fields matnr, werks,lvorm
    DATA: BEGIN OF ITAB_MARC OCCURS 0,
    MATNR LIKE MARC-MATNR,
    WERKS LIKE MARC-WERKS,  " Plant
    LVORM LIKE MARC-LVORM,  " Flag Material for Deletion at Plant Level
    END OF ITAB_MARC.
    * internal table itab_mard 2 fields
    DATA: BEGIN OF ITAB_MARD OCCURS 0,
    MATNR LIKE MARD-MATNR,
    LGORT LIKE MARD-LGORT,  " Storage Location
    END OF ITAB_MARD.
    SELECT-OPTIONS: S_MTART FOR MARA-MTART.
    INITIALIZATION.
    S_MTART-LOW = 'HALB'.
    S_MTART-HIGH = 'HAWA'.
    S_MTART-OPTION = 'BT'.
    APPEND S_MTART.
    START-OF-SELECTION.
    SELECT MATNR ERNAM MTART FROM MARA INTO TABLE ITAB_MARA WHERE MTART IN
    S_MTART.
    PERFORM DISPLAY.
    TOP-OF-PAGE.
    WRITE:/2(15) 'MATERIAL NO',20(20) 'CREATED BY',45(15) 'MATERIAL TYPE'.
    FORM DISPLAY.
    LOOP AT ITAB_MARA.
    WRITE:/ ITAB_MARA-MATNR UNDER 'MATERIAL NO' HOTSPOT ON,ITAB_MARA-ERNAM
    UNDER 'CREATED BY',ITAB_MARA-MTART UNDER 'MATERIAL TYPE'.
    HIDE: ITAB_MARA-MATNR.
    ENDLOOP.
    ENDFORM.
    AT LINE-SELECTION.
    CASE SY-LSIND.
    WHEN 1.
    SELECT MATNR WERKS LVORM FROM MARC INTO TABLE ITAB_MARC WHERE MATNR =
    ITAB_MARA-MATNR.
    PERFORM DISPLAY1.
    WHEN 2.
    SELECT MATNR LGORT FROM MARD INTO TABLE ITAB_MARD WHERE MATNR =
    ITAB_MARC-MATNR.
    PERFORM DISPLAY2.
    when 3.
    sy-lsind = 0.
    ENDCASE.
    FORM DISPLAY1.
    LOOP AT ITAB_MARC.
    WRITE:/ ITAB_MARC-MATNR HOTSPOT ON, ITAB_MARC-WERKS,ITAB_MARC-LVORM.
    HIDE: ITAB_MARC-MATNR.
    ENDLOOP.
    WRITE:/ SY-LSIND.
    ENDFORM.
    FORM DISPLAY2.
    LOOP AT ITAB_MARD.
    WRITE:/ ITAB_MARD-MATNR, ITAB_MARD-LGORT.
    ENDLOOP.
    WRITE:/ SY-LSIND.
    ENDFORM.
    regards
    ravish
    <b>plz dont forget to reward points if helpful</b>

  • Allow the user to control the width of the edit forum post input box

    I would like to control the width of of the edit-forum post input box.  This could be:
    automatically adjust the width of the box so that the box doesn't run off the right edge of the window.
    have a user global preference to set the preferred width
    at least, allow the user to change the width via the change size icon.  The three horizontal bars at the lower left of the input box. You can adjust the vertical dimension, but not the horizontal. TenFourFox 4.0.1. This is probably being blocked for some obscure reason.
    Here is an example of an over extended right margin:
    Curiously enough, the "software" let's me adjust the width & height of the add reason to edit text, but not adjust the width of the more important edit text box.
    Robert

    Testing
    Standard Reply box can be height adjusted but not width.
    Same with Advanced Editor
    No Adjustment at all in HTL Editor
    Edit.
    The Edit uses the Advanced Editor
    Only Height Adjustment again.
    I do seem to remember someone posting about the width and saying they could drag it over the edge of the right hand edge (Into the grey surround)
    This may have been a post in the lounge.
    It didn't actually try it at the time but have played with it since and have not seen it.
    Maybe it is something they "Fixed" in both senses of the word.
    Second edit.
    I can't alter the box that currently reads "Message Edited by:- ..."
    I also can't get this box to accept New lines  (they appear in the box but don't post that way)
    Corrected Spelling
    9:51 PM      Wednesday; May 11, 2011
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb( 10.6.7)
     Mac OS X (10.6.7),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously
    Message was edited by: Ralph Johns (UK)
    Message was edited by: Ralph Johns (UK)
    and new line with a line space as well

  • Way to allow the user access to the saved lists of this Z report

    We have a Z report that we want to run at midnight each Sunday and then view the output/layout first thing Monday morning. We can schedule the report to run but it appears that the only way we can save the output as a 'file' for later viewing is by using the "Save with ID" option, which puts the output into a SAP 'saved list'.
    The problem with this is that it doesn't appear to be possible to access that list from the Z-report - it would appear that you have to go into SQ01 and use the 'saved list' button. This means giving the Z- report user access to SQ01 as well as Z-report, which, for security (SOD) reasons we don't want to do.
    We can run the report in foreground with the output option "File store" and save the output as a file to a specified location,. But this option doesn't appear to be available when the report is scheduled as a background job. If this is done, the background job runs but there's no output anywhere, as far as we can tell.
    So what want is to run the report in background but with the output option 'File store' or equivalent (i.e. an output stored somewhere that the report user can view). Is this not possible, or have we missed something in setting up the report run?
    Or is there a way to allow the user access to the saved lists of this Z report without giving them T-code SQ01?
    Thanks

    Hi !
    I just wonder if the answer from Varishtb below did solve your propblem.
    I have exactly the same problem as you. I also want to be able to look at the saved list without using the sq01.
    If you solved it I will be grateful to get the solution.
    regards Lars
    answer:
    You can call the infoset query directly from a transaction code. There's
    no need to copy it as a 'Z-report' (or as a custom report). In fact,
    everytime you're copying an infoset query to a report, you're calling
    for problems the next time you face an upgrade. (That is because SAP
    changes the internal logic used to handle the infosets queries from
    version to version)
    We're using some infoset queries and they work fine this way.

  • Display some constant in the input field and allow the user to change it.

    Dear All,
    I have a requirement in WDA to display inputfield with some constant initially and allow
    the user to change that value according to his wish.Currently I am using UI Element
    InputField for this,but I am not able to show the constant initially.
    How can I achieve this pls suggest.
    Thanks,
    Reddy.

    Hi sudhir,
    To display with default values, you need to write your code in wddointi method.
    Check this code..
    * navigate from <CONTEXT> to <INPUT> via lead selection
      lo_nd_input = wd_context->get_child_node( name = wd_this->wdctx_input ).
    * get element via lead selection
      lo_el_input = lo_nd_input->get_element( ).
      lv_ship_point = '1001'.
    * set single attribute
      lo_el_input->set_attribute(
        name  =  `SHIP_POINT`
        value = lv_ship_point ).  // Now ship_point have initial value 1001.
    Cheers,
    Kris.

  • How can I allow the user to retake a quiz from the middle of it in Captivate 7?

    Hello Captivaters,
    I would like to force the learner to pass a quiz before he can continue on with the training.  If he doesn't pass the quiz, he will need to go back and take it again. The "retake" button allows him to do this, but I will actually like to have 4-5 of these "quiz checkpoints" in the eLearning -- each separated with presentation material --  so that the user proves he understands the material before advancing. 
    Therefore I would like to create my own "retake" button at the end of every "quiz checkpoint" that takes the learner back to the first question of that checkpoint (not to the first question in the training).  So far, I have been able to create a button that appears after he gets a certain amount correct to allow him to continue, and I want to create a button that appears that takes him back to the first question in the checkpoint if does not get the required amount correct and retake those questions.  The first part is easy, but I also need to add the function or reassign some variable to allow the user to retake the quiz. I hope I am making sense.. Any help would be much appreciated!
    - Ryan

    It's great!  Thanks again.
    Here is the issue now.  I guess it's not a huge problem, it's just if I can't find a better way, what I need to do will take a lot of time.
    Like I mentioned before, I created this "results" slide that on enter either shows a "congrats" button or a "retry" button, depending on whether or not the user passed the quiz.  I have copied this slide and pasted it behind all of the other sub-quizzes in the training, but when I do that, of course the link between the buttons and the conditional advanced action break.
    As you know, when you duplicate a slide, all of the names of the objects on that slide are "refreshed" and are replaced with new generic names because you are in fact creating new objects as well.  This means that I need to rename all of the objects on that slide (even though its a duplicate) and then replace all of the "old names" in the advanced action with these new object names..   Is there a faster way to do that?
    Thanks again!!
    Ryan

  • Is it possible not to allow the user to select radio button based on condi

    Hello All,
    I have two radio buttons ( Relation value 1 default , famid value 0 )
    can i create a situation where in the user cannnot select the famid radio based on some condition.
    The conditioin is that , the user should have selected atleast one item from three list controls then only i should allow the user to select famid radio else not ?
    thanks/kumar

    Hi,
    You can use javaScript to enable disable radio button. Call the javaScript from your select list onChange event.
    Hope this helps,
    Regards,
    Tajuddin
    web: http://tajuddin.whitepagesbd.com

  • Can I create a fillable PDF that allows the user to attach a file to the submitted form?

    There are suggestions in the Help documentation and on this site that indicate it is possible to attach files to a fillable PDF form that is being submitted. But I do not see any instructions for adding this functionality to a form. I am using Acrobat 9 Pro to create my form. I have a Submit button with an Action/Menu Item/Submit a form option, and the URL link for the submission is a local coldfusion file with a #FDF suffix. The export format is HTML. The form also contains a hidden EMAILTO field, with an Options/DefaultValue option identifying the recipient's email address. (I'm guessing the local cfm file uses this field.) There is also a hidden URL field in the form, and its Options/DefaultValue specifies the URL of the fillable form itself. (Perhaps the local cfm file uses this field too.)
    How can I add functionality to this form, using Adobe/PDF, to allow the user who submits the form to attach a file to the submission?

    You have to first configure a text field so it can be used for file selection. You do this on the Options tab of the field properties dialog. In order to select the corresponding check box, make sure only the "Scroll long text" option is selected.
    You then can set up a button that has the following JavaScript attached to the Mouse Up event:
    // Mouse Up script for button
    getField("upload_text_field").browseForFileToSubmit();
    Replace "upload_text_field" with the actual name of the file selection text field.

Maybe you are looking for

  • Finder cannot complete the operation... (Error code -36)

    Hello, I'm trying to share a file between my new iMac and my PowerBook via file sharing (Finder, Airport 802.11 n). Both computers are on 10.5.3. The iMac is a brand new one, so it's a fresh install. The PowerBook has a new harddrive and is a fresh i

  • How do i use itunes through an external hard drive?

    i have about 10G left on my laptop's harddrive. i've been told placing itunes on an external harddrive would free up space. i put everything on the harddrive, did the whole advanced stuff by changing the location, etc. etc. but ater all that there's

  • Connecting DV camera via firewire disconnects external firewire drive

    All of a sudden this has started happening. When i connect my video camera via firewire to my external Lacie harddrive, and turn the camera on, the drive I have it connected to goes off line. A window come up saying 'Device Removal'. When I disconnec

  • Aspect ratio inappropriate with final result

    hi guys.. we meet again..   i get a problem here.. look at the picture below.. above one is my comp when i make it to the final result below.. how to setting my comp to make it look the same with the final video? the final comp has a widescreen perfe

  • The account I'm locked out of is my BlackBerry. Net

    I'm locked out of my BlackBerry.net account. I'm constantly sent to my mailbox which I can't get in to because I can't download on my phone because I don't have password to install