Capslockkey function

Jan Sælid janselid at broadpark.no
Sun Mar 19 10:35:51 EST 2006


Thanks Eric 

That's a very good solution. But can I do this in a rawkey handler? 

The field is a number only field and I have to limit it so the user is only allowed to type numbers. No space or return. 
I also want to either give the user a warning that the capslock key is on or to translate the capslocked typing into numbers.

The best solution I have now is to translate each rawkey into the rawkey of the number. Thats 10 lines of code. 
But I would rather have a warning.... 

The capslockkey function does not seem to report anything other than the "up" state on my system.
I'm using rev 2.7 in XP

Jan

  ----- Original Message ----- 
  From: Eric Chatonet 
  To: Jan Sælid 
  Sent: Sunday, March 19, 2006 4:18 PM
  Subject: Re: Capslockkey function


  Hi Jan,


  If I understand well (not sure) you want the text always typed in capitals in some fields.
  if it is the case, you might prefer to transform by yourself the typed text on the fly without worrying about the capslock key:


  on keyDown pKey
   put toUpper(pKey) after target
  end keyDown


  That's just to give you the idea (you'll have to handle the selectedText to be more accurate :-)


  Le 19 mars 06 à 15:56, Jan Sælid a écrit :


    Someone has asked this before, but I haven't found an answer.

    I cannot get the capslockkey function to work. I have a number limited field where I want the user to be told if the capslock is down when they are typing.

    I use a rawkeydown handler in the field.




    The capslockkey always returns 'up".




    Any suggestions?



  Best Regards from Paris,
  Eric Chatonet
  ----------------------------------------------------------------------------------------------
  http://www.sosmartsoftware.com/    eric.chatonet at sosmartsoftware.com/






More information about the Use-livecode mailing list