Jump to content

Modifier key problems


This topic is 1375 days old. Please don't post here. Open a new topic instead.

Recommended Posts

A google search reveals that FMP not recognizing modifier keys is at least a decade old problem. It's hard to resist making some kind of a comment but I will resist. At any rate, it seems that restarting the computer, at least on a Mac, resolves the problem, (until it pops up again). 

My question is this: Is it understood what is it in the restarting process that corrects the problem, and if it is, is it something that can be imitated with some kind of script, command, etc?

Thanks

Edited by Asu
spell check
Link to comment
Share on other sites

I cannot reproduce your problem so i cannot say what causes it. What's more, I have never heard of such problem before reading your post. 

Do you have any system-enhancing utilities (such as a text expander) installed? That would be my first suspect. Do have have any plugins installed? That would be my second.

 

Link to comment
Share on other sites

  • 7 months later...
  • Newbies
On 1/11/2019 at 9:39 AM, comment said:

I cannot reproduce your problem so i cannot say what causes it. What's more, I have never heard of such problem before reading your post. 

Do you have any system-enhancing utilities (such as a text expander) installed? That would be my first suspect. Do have have any plugins installed? That would be my second.

 

For the record, I too have had this issue for quite some time. The only fix until now was a full reboot.

To your point, I am using TextExpander and quit the application. This has resolved my issue without the need to reboot.

Thanks!!

On 1/11/2019 at 8:58 AM, Asu said:

Dead link

Link to comment
Share on other sites

  • 10 months later...

Although an old thread I only just recently started to running into this problem after years of it working with no issue. I was using the CAPS LOCK key to stop a looped script.

The workaround I found was to use an applescript within the FM loop to check if the CAPS LOCK key was pressed and return the result to a global field in the database (called CAPSLOCK), and then had a step in the FM script to check that field to determine whether the script should exit.

Applescript below plus screenshot of how I placed it in the FM Script.

Commented out in the applescript is some code for some other key presses, like CTRL, CMD, FN keys. Disclaimer - I cannot take credit for writing the applescript, I found it somewhere on the web but no longer have the link and just tailored it to work with FM for this particular issue.

Quote

use framework "Cocoa"
on getModifierKeyBits()
    set modifierKeysDOWN to {command_down:false, option_down:false, control_down:false, shift_down:false, fn_down:false, capslock_down:false}
    set modifierBits to current application's NSEvent's |modifierFlags|()
    set modifierBits to modifierBits * 1
    if (modifierBits > 0) then
        
        if (modifierBits > 65535) then
            -- capslock key is pressed, subtract it away
            set modifierBits to modifierBits - 65536
            set capslock_down of modifierKeysDOWN to true
        end if
        
        --other key press options below
        (**
        if (modifierBits > 8388607) then
            -- fn key is pressed, subtract it away
            set modifierBits to modifierBits - 8388608
            set fn_down of modifierKeysDOWN to true
        end if


        if (modifierBits > 1048575) then
            -- command key is pressed, subtract it away
            set modifierBits to modifierBits - 1048576
            set command_down of modifierKeysDOWN to true
        end if

        if (modifierBits > 524287) then
            -- option key is pressed, subtract it away
            set modifierBits to modifierBits - 524288
            set option_down of modifierKeysDOWN to true
        end if


        if (modifierBits > 262143) then
            -- ctrl key is pressed, subtract it away
            set modifierBits to modifierBits - 262144
            set control_down of modifierKeysDOWN to true
        end if


        if (modifierBits > 131071) then
            -- shift key is pressed, subtract it away
            set modifierBits to modifierBits - 131072
            set shift_down of modifierKeysDOWN to true
        end if
        **)
        
    end if
    
    return modifierKeysDOWN
end getModifierKeyBits

set answer to capslock_down of getModifierKeyBits()


tell application "FileMaker Pro Advanced"
    tell database "ART"
        if answer = true then
            set field "CAPSLOCK" to "TRUE"
        else
            set field "CAPSLOCK" to ""
        end if
    end tell
end tell

 

 

 

Screen Shot 2020-06-23 at 17.53.21.jpg

Link to comment
Share on other sites

7 minutes ago, mikeytt said:

 I only just recently started to running into this problem after years of it working with no issue.

Are you saying that Filemaker can no longer detect the modifier key using the built-in Get(ActiveModifierKeys) function, but AppleScript can?

 

Link to comment
Share on other sites

As some of the previous posters mentioned (and from many other posts across the web) I'm not sure exactly what the issue is that causes FM to sometimes (not always) not recognise the Get(ActiveModifierKeys).

I only use Get(ActiveModifierKeys) in loops, basically to stop a loop, so I don't know if it is only an issue with using Get(ActiveModifierKeys) repetitively in a loop (other peoples experiences suggest this is not the case, that Get(ActiveModifierKeys) can fail in any situation),  but I  never used to have an problem before.

I tried various methods of using Get(ActiveModifierKeys) in the scripts, from direct calculation, to writing to a field and checking the field and writing to a variable, but none provided a permanent or stable solution.

The problem for me did coincide with an upgrade to FM17 and Sierra several months ago (yes I am quite a few OSX's behind but I require a stable workflow!) and also changing to Keyboard Maestro Editor (fantastic software!) from Quickeys. And the issue happens the same across all three of my macs. It never used to happen when I was using Yosemite with FM 14 and Quickeys.

From reading various posts it seems this problem has been around for the last 10 years or so, therefore I would guess that  it is not related to any specific OS or FM version, which suggests posisble interference from something third party.

I have read some anecdotal posts that other apps may affect the ability for FM to recognise active keys. Someone found that when they removed Application Enhancer prefs (APE, some daemon used by various apps) FM Get(ActiveModifierKeys) then worked fine for them after that.

In my case I therefore speculate that it may be down to my use of Keyboard Maestro which is always scanning for key presses, but that is just pure speculation. As KM is essential to my workflow I therefore needed a workaround for FM, so went the applescript route.

Link to comment
Share on other sites

This topic is 1375 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.