Jump to content

MonitoredKeys - HELP URGENT


herculanojs

Recommended Posts

I have great difficulty in understanding this process.

I need to disable the browser function keys (F1..F12)

Using the option in MainModule (monitoredkeys) got the result. But some things do not work as expected.

 

When active keys monitoring mainmodule, onkeydow the forms stop working. If active KeyenabledAll, onkeydown works, but editing components not, like the Edit. All that is entered simply is not shown.

 

How should I use it?

How the operation of properties?

post-1670-0-17833700-1476549004_thumb.png

post-1670-0-27213200-1476549014_thumb.png

MonitoredKeys.rar

Link to comment
Share on other sites

Hi,

 

Try:

 

1. MainForm -> MonitoredKeys -> Enabled = True

 

2. MainForm -> MonitoredKeys -> Keys -> in All items set HandleBrowser to False

 

3. UniMainModule -> MonitoredKeys -> Keys -> in All items set HandleBrowser to False

 

Best regards.

Link to comment
Share on other sites

I believe you have not understood the real functionality of it, or there is a problem in this method. Because for example I want the browser is prevented from utilizasr for example the standard keys F3 or F5.

However I want to be able to onkeydow for example check if the user used a key that I am monitoring and run something.

Apparently, if I active monitoring, onkeydown response of the form disappears.

Link to comment
Share on other sites

I'm sorry, maybe I did not understand your issue

 

 

Because for example I want the browser is prevented from utilizasr for example the standard keys F3 or F5.

 

this allows to prevent:

 

2. MainForm -> MonitoredKeys -> Keys -> in All items set HandleBrowser to False

 

3. UniMainModule -> MonitoredKeys -> Keys -> in All items set HandleBrowser to False

Link to comment
Share on other sites

  • Administrators
object UniMainModule: TUniMainModule
  OldCreateOrder = False
  MonitoredKeys.Enabled = True
  MonitoredKeys.Keys = <
    item
      KeyStart = 112
      KeyEnd = 123
      HandleBrowser = False
    end
    item
      KeyStart = 1
      KeyEnd = 111
    end
    item
      KeyStart = 124
      KeyEnd = 255
    end>
  Height = 384
  Width = 582
end

You need 3 groups of keys for that. In F1..F12 group just unset HandleBrowser.

Link to comment
Share on other sites

  • 1 year later...

Hello there UniGUI Developpers ! (:

 

I handle perfectly my F1..F12 keys  with MainModule and MainForm ... except when I have my focus in component :

 

For instance, when I am on the login page, on edits, if I press F1, the help of Chrome is fired .. how may I prevent browser event when I got the focus in components ? 

Link to comment
Share on other sites

Hello,

 

Maybe like this:

 

For example,

 

UniLoginForm1 -> Script:

document.addEventListener('keydown', function(event) {
    if (event.key == 'F1') {
        event.cancelBubble = true;
        event.returnValue = false;
        event.keyCode = false;
        return false;
    }
});
Link to comment
Share on other sites

First of all, thanks for the quick answer! (:

 

Unfortunatelly, this is not what I am searching as I just want to cancel browser events as I have my own event linked to  vk_F11 and other keys.

 

Regards,

Link to comment
Share on other sites

  • Administrators

Hello there UniGUI Developpers ! (:

 

I handle perfectly my F1..F12 keys with MainModule and MainForm ... except when I have my focus in component :

 

For instance, when I am on the login page, on edits, if I press F1, the help of Chrome is fired .. how may I prevent browser event when I got the focus in components ?

Have you tried using MonitoredKeys property?

 

Sent from my SM-N950F using Tapatalk

Link to comment
Share on other sites

  • 2 years later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...