[CLOSED] Browser events

Page 1 of 2 12 LastLast
  1. #1

    [CLOSED] Browser events

    Hello

    I will know if it is a way to intercept browser events like clicking on F11 to go in/out full screen for example?
    Last edited by Daniil; Jan 22, 2013 at 5:07 AM. Reason: [CLOSED]
  2. #2
    Hi @feanor91,

    I would try to use a KeyMap.
  3. #3
    Thanks, I will see keymap example

    Seem possible but why we have to click on center region? Idea here was user simply click F11 without clicking anywhere. Could you explain please?
    Last edited by feanor91; Jan 18, 2013 at 6:58 AM.
  4. #4
    I think it is because our examples are loaded into iframes.

    I just tried to load this example separately. It appears that it does not require a click before.
  5. #5
    Fine, thanks, I will look deeper
  6. #6
    OK, it works....
    ....but only to go on full screen. clicking a second time to go out full screen did not conduct key to be intercepted by keymap. Just try with this little piece of code:

    <%@ Page Language="C#" %>
     
    <%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
     
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
     
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head id="Head1" runat="server">
        <title>Ext.NET v2 Example</title>
    </head>
    <body>
        <ext:ResourceManager ID="ResourceManager1" runat="server" />
                <ext:KeyMap ID="KeyMap1" runat="server" Target="={Ext.isGecko ? Ext.getDoc() : Ext.getBody()}">        
                    <Binding>
                            <ext:KeyBinding Handler="alert('F11 clicked');">
                            <Keys>
                                <ext:Key Code="F11" />
                            </Keys>
                        </ext:KeyBinding>    
                     </Binding>        
                </ext:KeyMap>
    </body>
    </html>
    Edit: I have a second problem:

    Event is fired BEFORE browser goes fullscreen so the
    screen.availHeight
    value is wrong (size before fullscreen) so I'm not able to get good dimention to resize window into the desktop.
    Last edited by feanor91; Jan 21, 2013 at 12:14 PM.
  7. #7
    Quote Originally Posted by feanor91 View Post
    ....but only to go on full screen. clicking a second time to go out full screen did not conduct key to be intercepted by keymap.
    The KeyBinding Handler executes on each F11 for me. What FireFox version are you testing with?

    Quote Originally Posted by feanor91 View Post
    Edit: I have a second problem:

    Event is fired BEFORE browser goes fullscreen so the
    screen.availHeight
    value is wrong (size before fullscreen) so I'm not able to get good dimention to resize window into the desktop.
    Well, maybe, some delay for your handler could help.

    Please notice that ResourceManager has the WindowResize event. Maybe, you could just use it.
  8. #8
    Quote Originally Posted by Daniil View Post
    The KeyBinding Handler executes on each F11 for me. What FireFox version are you testing with?
    Hum...Chrome..And you're right; it works on Firefox :(

    Well, maybe, some delay for your handler could help.
    No; I test different way, and even in full screen under chrome, avalaible heigh is always wrong, I use window.height in place.

    Please notice that ResourceManager has the WindowResize event. Maybe, you could just use it.
    Could be easier, I will try
    Last edited by feanor91; Jan 21, 2013 at 2:51 PM.
  9. #9
    Reproduced with Chrome. Well, such issues are possible with native browser hot-keys.

    And it might be difficult (sometimes just impossible) to get it working, because it is not always possible to override default browser behavior.

    Quote Originally Posted by feanor91 View Post
    Well, maybe, some delay for your handler could help.
    No; I test different way, and even in full screen under chrome, avalaible heigh is always wrong, I use window.height in place.
    If you will have a chance, please provide an example with a delay to test.
    Last edited by Daniil; Jan 21, 2013 at 4:13 PM.
  10. #10
    And it might be difficult (sometimes just impossible) to get it working, because it is not always possible to override default browser behavior.
    Yes, I imagine.

    If you will have a chance, please provide an example with a delay to test
    Useless, as I said, chrome did not update availableheight correctly when in full screen.

    By the way,I manage to achieve, more or less, effect I want with resize event in resource manager
Page 1 of 2 12 LastLast

Similar Threads

  1. Probably bug in DatePicker - browser crash
    By Svr77 in forum 2.x Help
    Replies: 4
    Last Post: Nov 26, 2012, 11:20 AM
  2. ext.net 2.0 web browser proxy question
    By snakeeyes in forum 2.x Help
    Replies: 0
    Last Post: Oct 12, 2012, 3:29 AM
  3. Replies: 15
    Last Post: Feb 03, 2011, 1:27 PM
  4. datecolumn bug on crome browser
    By maxdiable in forum 1.x Help
    Replies: 2
    Last Post: Sep 08, 2010, 11:40 AM
  5. Prevent browser handling key?
    By dbassett74 in forum 1.x Help
    Replies: 0
    Last Post: May 26, 2009, 7:03 PM

Posting Permissions