[CLOSED] KeyMap and Control Key only

  1. #1

    [CLOSED] KeyMap and Control Key only

    Hi,

    Is there a way to detect that only Control key is pressed (without any other key) ?

    I would like to change some behavior in my app if user hold Control key and click something.

    Thank you,
    Last edited by Daniil; Dec 31, 2014 at 3:02 PM. Reason: [CLOSED]
  2. #2
    Hi @matt,

    Let's start with this example.

    Example
    <%@ Page Language="C#" %>
    
    <!DOCTYPE html>
    
    <html>
    <head runat="server">
        <title>Ext.NET v2 Example</title>
    
        <script>
            Ext.onReady(function() {
                Ext.getDoc().on("mousedown", function(e) {
                    if (e.ctrlKey) {
                        console.log("Mouse click with Ctrl");
                    }
                });
            });
        </script>
    </head>
    <body>
        <form runat="server">
            <ext:ResourceManager runat="server" />
        </form>
    </body>
    </html>
    This might help you to deal with a case when a user presses more than one key.
    http://stackoverflow.com/questions/1...-in-javascript

Similar Threads

  1. [CLOSED] KeyMap
    By tad in forum 2.x Legacy Premium Help
    Replies: 4
    Last Post: Jun 20, 2014, 5:52 AM
  2. [CLOSED] Ext 2.1.1 Razor and KeyMap
    By jphms in forum 2.x Legacy Premium Help
    Replies: 1
    Last Post: Apr 04, 2013, 12:33 AM
  3. Keymap not functioning!
    By alpeter in forum 1.x Help
    Replies: 3
    Last Post: Jan 14, 2013, 8:19 PM
  4. [CLOSED] How to use new keymap in
    By xeo4.it in forum 2.x Legacy Premium Help
    Replies: 2
    Last Post: Sep 25, 2012, 3:30 PM
  5. Replies: 6
    Last Post: Sep 04, 2012, 12:59 PM

Tags for this Thread

Posting Permissions