Results 1 to 2 of 2

Thread: Keyboard shortcuts and wrapping Ext JS

  1. #1
    Sencha Premium Member EPV's Avatar
    Join Date
    Dec 2010
    Location
    Sweden
    Posts
    341
    Answers
    36
    Vote Rating
    42
      0  

    Default Unanswered: Keyboard shortcuts and wrapping Ext JS

    Been struggeling with the issues of using keyboard navigation in an Ext JS web application.

    Is it possible to use keys like "ctrl+s", "Backspace" or "F1" without messing with the browser?

    A fix would possible be to wrap the web-page in Titanium Desktop. Anyone with good/bad experinces with this? Other options?

    Thanks / E

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,324
    Answers
    3884
    Vote Rating
    1297
      0  

    Default

    This captures ctrl + s:

    Code:
    new Ext.util.KeyMap(document.body, {
        key  : 's',
        ctrl : true,
        fn   : function(keycode, e) {
            e.stopEvent();
    
            console.log('ctrl + s was pressed');
        }
    });
    I'm on Mac and the browser doesn't launch the save so I'm not sure if stopEvent will prevent the browser behavior.

    Wonder if the keydown event would be better.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •