Monday, September 1, 2014

#1 2011-07-08 03:46:24 pm

houdini
Member
Registered: 2007-07-22
Posts: 11

calculator and keyboard

I am programming a timecode calculator in AppleScript Studio. User interaction with the calculator is done by mouse clicks on push buttons. Is it possible to implement interaction with keystrokes from keyboard in ApplesSript Studio?

Offline

 

#2 2011-07-08 04:02:40 pm

DJ Bazzie Wazzie
Member
From: the Netherlands
Registered: 2004-10-20
Posts: 1893

Re: calculator and keyboard

Yes and it is quite easy too.

Go to interface Builder
Select the button you want to respond to a keystroke
Then in the inspector you'll see a field with key equivalent, select it and press the number you want to respond to it to.


Kind regards

Offline

 

#3 2011-07-09 12:03:42 am

houdini
Member
Registered: 2007-07-22
Posts: 11

Re: calculator and keyboard

Thanks for the tip! Nevertheless, I have to select another key with numbers like Command (ie Command+0). Same behaviour with +,=,/ or * operators.

Offline

 

#4 2011-07-09 04:09:34 am

DJ Bazzie Wazzie
Member
From: the Netherlands
Registered: 2004-10-20
Posts: 1893

Re: calculator and keyboard

that doesn't matter unless you want one button to respond to multiple key values. The reason why it doesn't matter is that it responds to a key value and not a key code. I have a key with a "=" value and when pressed shift it's value is "+" so even if it is the same key it can send the action to multiple buttons depending on which command key you simultaneously press.


Kind regards

Offline

 

#5 2011-07-11 12:24:11 pm

houdini
Member
Registered: 2007-07-22
Posts: 11

Re: calculator and keyboard

In fact, i would like to say that a key equivalent "-" does not work. You need to add a modifyer key as Command + "-" and for a calculator that is not practical for users.

Offline

 

#6 2011-07-11 03:35:00 pm

DJ Bazzie Wazzie
Member
From: the Netherlands
Registered: 2004-10-20
Posts: 1893

Re: calculator and keyboard

Well I totally understand but it would and can give you problems when you go international for sure when you're on key code level.


Kind regards

Offline

 

Board footer

Powered by FluxBB

[ Generated in 0.117 seconds, 10 queries executed ]

RSS (new topics) RSS (active topics)