« FileMaker field naming conventions | Main | Merge Expressions »

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d8341d284e53ef00d834d9591369e2

Listed below are links to weblogs that reference Custom functions to simplify reading the current state of modifier keys:

Comments

Charles Ross

Mikhail,

Thanks very much for this article. In case you're interested, I used the concepts here to create a slightly different custom function that works in place of the five you have:

ModifierKeyIsActive( ModifierKey ) = ~BitIsSet( Get( ActiveModifierKeys ); ModifierKey )

My ~BitIsSet function is the same as your Bit Is Set (just a different naming convention). I then have other custom functions for the constant powers, i.e., kModifierCommand = 16. Of course, I have one custom function that operates in place of your five, but add five others to handle the constants for readability. Just my preference. :) Of course, this gets called like this:

ModifierKeyIsActive( kModifierCommand )

Chuck

m.edoshin

I actually like your variant more, because it's easier to set up: one function and five straightforward constants. As I use my variant, I noticed that it takes extra time to figure out what bit stores the state of the Option key, if its code in help is 8 :) Of course, it happens only when I add functions in a new file, yet it's less efficient.

I also noticed I've switched from using similar all-inclusive functions like "Window Mode is Find()" to simpler Get( WindowMode ) = FIND MODE, where FIND MODE is a constant, so I believe I adopt your style for modifiers too. Makes code a bit cleaner. Thanks, Chuck :)

Jordi Rodríguez

Hello,

And how to control these keys using IWS (Instant Web Serrver)?

The answer of the funcition Get( ActiveModifierKeys ) is always 0 when the key of a client is pressed using the web browser.

Thanks in advance

Jordi Rodríguez

m.edoshin

Hi Jordi,

Unfortunately, in IWP this is not possible.

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment