..:: Blog ::..

 ToolBook Blog Minimize

Aug 13

Written by: Tomas Lund
Wednesday, August 13, 2008 12:08 PM

or

"Using a combination of keys to create keyboard shortcuts for navigation"

In my previous article "Keyboard shortcuts in ToolBook HTML" I showed how one can implement keyboard shortcuts using the arrow keys to navigate between the pages.

Now what if you wanted to use a combination of keys to navigate?

Using the SHIFT or CTRL keys along with the arrow keys would only require a small tweak of the example I used in my first article on keyboard shortcuts.

The original on key up handler looked like this:

-- On key up... ----------------------------------------------------------------
Comment: Tomas Lund, ToolBookConsulting.com, July 2008
Comment: Navigate when the user press the arrow keys or the end key while pressing the ALT key
If keyCode = 37
  Comment: User pressed the Left arrow key
  Go to the previous page
Else if keyCode = 39
  Comment: User pressed the Right arrow key
  Go to the next page
Else if keyCode = 35
  Comment: User pressed the END key, now trigger self is the same as the user clicking the button
  Trigger Self
End if

The on keyup handler has three parameters in total
keyCode which holds the value of the key that was pressed, and the shiftDown and ctlrDown parameters which will be true if the shift and ctrl keys are pressed and or false if they are not

 So for instance if we want to make CTRL plus the left arrow go to the previous page and so on, we just need to change the code to this:

-- On key up... ----------------------------------------------------------------
Comment: Tomas Lund, ToolBookConsulting.com, July 2008
Comment: Navigate when the user press the arrow keys or the end key while pressing the CTRL key
If ctlrDown
Comment: User pressed the CTRL key
 If keyCode = 37
   Comment: User pressed the Left arrow key
 Go to the previous page
 Else if keyCode = 39
   Comment: User pressed the Right arrow key
   Go to the next page
 Else if keyCode = 35
   Comment: User pressed the END key
   Comment: trigger self is the same as the user clicking the button
   Trigger Self
 End if
End if

Note I haven’t created a sample for this as the above change is fairly simple to apply to my previous example which you can download from the download page.

I hope this makes sense, As always I appreciate comments, questions and suggestions below.
 

Tags:

Re: Keyboard shortcuts in ToolBook HTML 2

Wholesale trend Jewelry
When committing Jewelry Bags in diamond jewelry from a store, or seeing a person getting a complete flourished add-ons business, a believed might work above views of having an special trend trinkets or trend garments outlet. If not then produce a next believed complete of fun and glamor that is frequently loved by owing a store of own. previously a variety of unique and innovative ornaments have been made by retailers, but nowadays trend add-ons are developed with wide variety of materials like metal, plastic, gems, semi valuable rocks and even wood.
Earlier most of these items have been created outdoors of higher level of quality plastic, Murano glass was employed for art galleries work, shell was employed for making jewels to put on on beaches, while semi valuable rocks have been employed for making lapidary. on account of these classic designs it turned out in a positioning to bring new modifications in accordance with now times also to produce trend charms extra affordable.
The market place of wholesale trend diamond jewelry has evolved with new ideas and innovative designs that are prepared with natural Hair Accessories materials and hand created art to produce ultimate beauty. A person can look for wide array of

By srfsrf2 on   Friday, August 12, 2011 3:28 AM

Re: Keyboard shortcuts in ToolBook HTML 2

San Diego Chargers #11 Legedu Naanee Dark blue Jerseys
San Diego Chargers 56 S. Merriman baby blue replica Jerseys

By vcsadfgw on   Tuesday, August 30, 2011 4:33 AM

  
 Search Minimize


  
 Quick links Minimize


  
 Blog List Minimize


 Print   


Copyright 2007 by ToolBookConsulting.com   Terms Of Use  Privacy Statement