Wintermute Engine Forum

Wintermute Engine => Technical forum => Topic started by: Akatosh on July 02, 2010, 04:13:00 PM

Title: Overwrite Keyboard functions on Text box areas.
Post by: Akatosh 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?
Title: Re: Overwrite Keyboard functions on Text box areas.
Post by: Mnemonic 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.