• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Key board Control on HTML page

 
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all

Please tell me that either it is possible to make keyboard control on JSP page or not.

I built a form with some text field and and two button.
Name of buttons are reset and save.

Now when I click on any button I will get the desire functionality but I also want to use Control + S for save button and Control + U for reset.

If you know that how it is posible please give some reference

Thanks All
[ January 19, 2005: Message edited by: Syed Saifuddin ]
 
Sheriff
Posts: 67750
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to the HTML/Javascript forum.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Basic idea:



You may run into trouble with certain key combos since they already exist.

Eric
 
Syed Saifuddin
Ranch Hand
Posts: 130
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Eric Pascarello

Thank you for your immidiate responce. I will try my best to use your code and idea but it is only working when the focus is on button.

Now plz try to get my point: I want to just ues a key combination let say control + s for save option . Even If the explorer is under focus and save button is not focused I want this key combination to work .

Is this requirement is possible

Thankyou.
 
Eric Pascarello
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
you need to add the onkeypress handler to the buttons

onkeypress="handlePress()"

I think that should work

Eric
 
She's out of the country right now, toppling an unauthorized dictatorship. Please leave a message with this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic