Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Author Topic: Forbidding Certain Keys in EDIT Box  (Read 2449 times)

0 Members and 1 Guest are viewing this topic.

CMK2901

  • Lurker
  • *
  • Karma: 1
  • Offline Offline
  • Gender: Male
  • Posts: 35
  • Zoidberg is afoot!
    • View Profile
    • CMK Studios
Forbidding Certain Keys in EDIT Box
« on: January 30, 2007, 01:37:45 AM »

Hi everyone,

I'm tweaking the save dialog and I noticed that if I type the "|" character into the edit box, it ends up causing a line break in the text.  Therefore, I would like to stop this key (among others) from being entered into the edit box for the save name.  I couldn't find a keycode for "|" and I'm not quite sure how I would implement this even if I did.

Any suggestions?
Logged
CMK Studios
I don't think we're hearing the same voices.

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Forbidding Certain Keys in EDIT Box
« Reply #1 on: January 30, 2007, 08:03:43 PM »

Well, you probably won't be able to catch the keypress before the character is inserted into the editor. You can only catch the event when the text is modified (the editor triggers an event in its parent window; the name of the event is equal to the name of the editor). So you could probably handle the event, check if .Text contains some invalid characters, and remove them. I'm not sure it would work too well, though..
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.034 seconds with 19 queries.