Function Key Handler
 

Function Key Handler

This is the test page for a Function Key Handler for tempusfugit.me.uk

There are two scripts on this page both were found making an AI search for how to do these tasks. I am not sure how I feel about this as although I found the solution to my problem I am not sure how this technique will develop in the future.

The first key handler:

Press a key to see the result here.

Top

The 2nd Handler:

This handler adds an EventListener when the page loads and will detect any keypress.

The AI code included two alert()s that trapped the "Enter" and the "Esc" keys. I changed the code on this page to detect the F2 keypress and then un-hide the hidden text.

I have integrated this code into my page on Long Melford. Pressing F2 on that page will display links to the former (and present) residents of the Hall.

Console.log messages are also generated by the code and this can be used to see what is going on. The default function keys are (normally) disabled by the first handler. In this case I commented out the event.preventDefault() call.

This is when you have Function Keys

Getting this technique to work on a touch device is an interesting project.

Links

Link to PDF Disabled

If you require a copy please email tempusfugit.me.uk

Top

References - a note on these -

  • Ideas to get this to work on iOS - https:// stackoverflow.com/questions/13005969/ it-is-possible-to-show-keyboard-without- aiusing-uitextfield-and-uitextview-iphone
  • Fn key - https://en.wikipedia.org/wiki/Fn_key