0

I want my website to be shown on a 'kiosked' computer (i.e. the site is the only thing visible on the screen). And I have a card reader that sends a string to whatever text field is active when a card is shown to it. After the string the card reader sends a tab-key.

Now how could I receive the string each time the card is shown and at the same time keep the website active at all times. When the tab-key is sent it should not tab to the address bar or anywhere else, if it would then I wouldn't receive the next string as the site wouldn't be active any longer.

Also, the received string should never be visible on the the screen, I just want to receive it in the code behind.

How might I solve this?

mdc
  • 1,161
  • 6
  • 22
  • 37

1 Answers1

0

You could handle the change event of the textbox and post the data via AJAX to your controller then re-focus the field.

Also, the received string should never be visible on screen

Few ways of doing that, make the field blend into the page (e.g. change the background/fore colour) or hide it by putting a div over it etc.

James
  • 80,725
  • 18
  • 167
  • 237
  • I'm hoping there is a way to solve this without having a textfield at all. I guess the card reader sends the string even if there is no text field, its just not visible. So I guess I want something that listens to key presses when the site is active and receives the input in the code. – mdc Dec 18 '12 at 10:06
  • another way is to listen to your cardreader event from its API if you have the SDK, most card readers should have a .Net SDK – Nerdroid Dec 18 '12 at 10:14
  • @mdc You could try messing about with the `keypress`/`keydown` events on the body of your page, however, I am not sure how it will handle *multiple* keys. Your simplest option would be to use a standard text field and just hide it from the user. – James Dec 18 '12 at 10:19