Please login or register.

Login with username, password and session length
Advanced search  

News:

For WME related articles and tutorials visit WME Resource Center.

Author Topic: Overwrite Keyboard functions on Text box areas.  (Read 2282 times)

0 Members and 1 Guest are viewing this topic.

Akatosh

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Gender: Male
  • Posts: 14
  • Discomfort generates evolution.
    • View Profile
Overwrite Keyboard functions on Text box areas.
« on: July 02, 2010, 04:13:00 PM »

Good evening,

I'm trying to overwrite the keyboard controls on a single line editor controls. But I've failed so far.

I have something like this on the window's script.

Code: WME Script
  1. on "Keypress"
  2. {
  3.   var button;
  4.  
  5.   if(Keyboard.KeyCode==VK_ESCAPE){
  6.     button = this.GetControl("close");
  7.     button.Press();
  8.   }
  9.   else if(Keyboard.KeyCode==VK_RETURN){
  10.     run();
  11.   }
  12.   else if (Keyboard.KeyCode==VK_DOWN){
  13.         // Run something.
  14.   } 
  15. }
  16.  

I've tried to overwrite the keyboard's UP and DOWN keys but I've found out that those keys, as well as all "cursor moving" keys, can't be overwritten, the game just ignores that code.

Is it possible to overwritten or is it imbedded in the code?

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Overwrite Keyboard functions on Text box areas.
« Reply #1 on: July 05, 2010, 05:00:11 PM »

I wouldn't say it's possible. The control handles the keys internally, so the game object never really has a chance of handling them.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.046 seconds with 21 queries.