Jump to content

Recommended Posts

Posted
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

Posted

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.

Posted
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.

Posted

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

Posted

Not at all, you've helped a lot just because give me attention. This is much more important than the solution itself, since there is worse than not find a solution, is not having anyone even resposanda our longings.

  • Upvote 1
Posted
What I need is the browser to disable the keys especias F1..F12, but want the onKeyDown event of the form to continue to function.

 

This does not happen when I activate monitoredkey property either in form or in mainmodule.

  • Administrators
Posted
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.

  • 1 year later...
Posted

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 ? 

Posted

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;
    }
});
Posted

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,

  • Administrators
Posted

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

  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...