Jul 04, 2013, 12:49 PM
[CLOSED] KeyMap and browsers events
Hi,
I'm using Ctrl+W and Ctrl+T shortcuts, but it's always the browser event which is fired.
The following code close the tab and doesn't display my alert.
Thanks a lot !
I'm using Ctrl+W and Ctrl+T shortcuts, but it's always the browser event which is fired.
The following code close the tab and doesn't display my alert.
@(
X.Viewport().ID("Viewport").Layout(LayoutType.Border)
.KeyMap
(
X.KeyMap()
.Target("={Ext.isGecko ? Ext.getDoc() : Ext.getBody()}")
.Binding(b => {
b.Add(Html.X().KeyBinding().Ctrl(true).KeysString(((int)KeyCode.W).ToString()).DefaultEventAction(EventAction.PreventDefault).Handler("alert('click');"));
})
)
)
But the following is working, the only change is the keycode 'A'@(
X.Viewport().ID("Viewport").Layout(LayoutType.Border)
.KeyMap
(
X.KeyMap()
.Target("={Ext.isGecko ? Ext.getDoc() : Ext.getBody()}")
.Binding(b => {
b.Add(Html.X().KeyBinding().Ctrl(true).KeysString(((int)KeyCode.A).ToString()).DefaultEventAction(EventAction.PreventDefault).Handler("alert('click');"));
})
)
)
How can I use Ctrl+W or Ctrl+T without firing my browser event (close/open tabs)Thanks a lot !
Last edited by Daniil; Jul 10, 2013 at 4:25 AM.
Reason: [CLOSED]