【问题标题】:do browser default if no keydown shortcut如果没有快捷键,则默认浏览器
【发布时间】:2012-10-31 07:15:50
【问题描述】:

在我的用户控件中,我覆盖了 keydown ,例如我检查

       if (Keyboard.Modifiers == ModifierKeys.Control && e.Key == System.Windows.Input.Key.E)
       {

       }

但是我注意到像 Ctrl+P 这样的浏览器主快捷键不起作用,知道如何解决这个问题 同样在 Internet Explorer 中,如果我在 keydown 中检查 ctrl+e 以执行某些任务,则快捷方式执行浏览器快捷方式应该执行的操作

任何想法

【问题讨论】:

    标签: c#-4.0 silverlight-4.0


    【解决方案1】:

    您提到了浏览器,我假设您要求使用 javascript。请考虑来自http://www.openjs.com/scripts/events/keyboard_shortcuts/
    的shortcut.js 阅读:http://www.openjs.com/scripts/events/keyboard_shortcuts/#keys

    Example:
    shortcut.add("Down",function() {
        alert("keydown!");
    });
    
    //Remove the shortcut
    shortcut.remove("Down");
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-12-31
      • 2014-06-22
      • 2011-04-10
      • 2021-07-06
      • 2023-03-19
      • 2010-11-27
      • 2012-03-07
      相关资源
      最近更新 更多