Results 1 to 6 of 6

Thread: Capturing keystrokes in HTML form

  1. #1

    Thread Starter
    Addicted Member DJ_Catboy's Avatar
    Join Date
    Jan 2003
    Location
    Suffolk, UK
    Posts
    159

    Capturing keystrokes in HTML form

    Hi,

    I am developing an HTML page for use on a windows CE terminal. Unfortunately I cannot use Javascript for this task (which I would normally have done) as there are issues with CE and JVM. However, the problem or the task which I need to achieve is as follows:

    I have a screen with three items on it. I would like these items (which are at present hyperlinks) to be selectable via a keypress "1", "2" or "3" accordingly. Does anybody know of a way to capture a keypress in plain standard HTML and action a hyperlink?

    Thanks (hopefully) in advance!

    DJ

  2. #2
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    As far as I know regular HTML can't capture key strokes. Flash definately can. Maybe some XHTML or DHTML can do it, but I don't know how. Flash might not be a very good option either as the focus has to be on the flash for its key capturing to work.

  3. #3
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Unfortunately I cannot use Javascript for this task (which I would normally have done) as there are issues with CE and JVM.
    If by JVM you're referring to the Java Virtual Machine, JavaScript has nothing to do with that. The JVM is to execute Java programs. Java is a completly different language than JavaScript.

    CSS2 has the access-key property that allows some limited keyboard intercepting. Don't know about browser support though, IE is always a risk and IE on CE even more so. Plain HTML hasn't got anything.

    Acidic: for future reference, XHTML has exactly the same capabilities as HTML, it's just a slightly different syntax.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  4. #4

    Thread Starter
    Addicted Member DJ_Catboy's Avatar
    Join Date
    Jan 2003
    Location
    Suffolk, UK
    Posts
    159
    OK so I have worked out that I have spent all day installing a JVM onto my WinCE device then worked out that I didn't actually need it anyway! My boss really loves me today!

    So, the problem I am now faced with is that I want to use the following to get my screen going:

    <body onKeyPress="javascript:doKeyPress();">

    and then above this I have a small function:

    Code:
    function doKeyPress() {
      window.alert('Something Pressed');
    }
    Now this code works on my local machine running ie6 WinXP, etc... but when I run it on my WinCE device the code does not run. Anybody know why? I am currently in the process of trying to run WindowsUpdate on my WinCE device - it is proving quite entertaining actually!

    Thanks for the help guys...

    DJ

  5. #5
    Frenzied Member Acidic's Avatar
    Join Date
    Sep 2003
    Location
    UK
    Posts
    1,090
    thanks for that Corned Bee.
    I was going to suggest CSS2 but I thought it was made to make things look nicer. Anyway, if JavaScript can solve the problem, go for that.

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Errr...

    My answer would be "Because CE sucks and actually most MS software sucks", but you probably don't want to hear that.

    But seriously, I have no idea. Never used CE.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width