How to recognizze dot key pressed (just as excel do).

VA Smalltalk is a "100% VisualAge compatible" IDE that includes the original VisualAge technology and the popular VA Assist and WidgetKit add-ons.

Moderators: Eric Clayberg, wembley, tc, Diane Engles, solveig

How to recognizze dot key pressed (just as excel do).

Postby mariocarrera » Wed Oct 03, 2007 12:25 am

Hi all,
I'm using vast 601, because I'm in Italy I need to recognize the key"." when pressed from the keyboard and the key "." pressed from the numeric keyboard.
because the when pressed the dot key from the numeric keyboard I need to convert in coma (our decimal point).
to recognize the pressed key I will use the following method:

myText widget
addEventHandler: KeyPressMask
receiver: self
selector: #keyEventHandler1:clientData:event:
clientData: nil.

Thanks for help
Mario
mariocarrera
 
Posts: 17
Joined: Thu Dec 14, 2006 6:53 am

Postby Sam De Block » Wed Oct 03, 2007 12:51 am

Your event will be a CwKeyEvent with character: $. (keycode 46).
From there you can work your magic :p
Sam De Block
 
Posts: 17
Joined: Thu Nov 09, 2006 4:25 am

Postby mariocarrera » Wed Oct 03, 2007 6:05 am

Maybe I do not explain my problem very well.
of course when I press the dot key the value will 46. My problem is to know if the user pressed the "." key on the right side of the keyboard (numeric keyboard) or if the user pressed the "." on the left side of the keyboard.

Mario
mariocarrera
 
Posts: 17
Joined: Thu Dec 14, 2006 6:53 am


Return to VA Smalltalk 7.0, 7.5 & 8.0

Who is online

Users browsing this forum: Yahoo [Bot] and 1 guest