Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Gelow 4 posts 23 karma points
    Oct 05, 2009 @ 23:18
    Gelow
    0

    ALT + S in TextString property

    Hi,

    I've problem with Right ALT + S button on keyboard in TextString property. Normally ALT + S in Polish (I'm from Poland :)) means special polish letter "". When I press RALT + S on TextString property in Content section nothing happens. Actually there is no way to write down "" in TextString input - only copy and paste from other editor. In Richtext Editor, ALT+s works fine without any problems.

    Any ideas how to solve this problem?

    G.

  • Dav 44 posts 69 karma points
    Oct 19, 2009 @ 11:06
    Dav
    0

    Has anyone found a trace? Problem still persists and our users would love not to do ctrl-c / ctrl-v every now and then :-) From what I've found Alt-S is used an a 'skip to search' keyboard shortcut... which nevertheless seems to do absolutely nothing in the UI (save for stealing the "ś" of course ;-)

    Is there a way out?

  • Dav 44 posts 69 karma points
    Oct 19, 2009 @ 13:14
    Dav
    0

    Heh, answering our own question here in case some of you run into the same issue :-) We though there's nothing a good Firebug session cannot debug, and voila. It turned out that AltGr (right alt for those of you on US keyboard layouts) works in a very similar way to Ctrl (for historical reasons). So much so that JavaScript treats AltGr modifier the same as a Ctrl modifier!

    So whenever a user pressed AltGr-s, Umbraco thought he/she meant Ctrl-s, with all the blessed consequences (Save)... and inability to output the infamous Polish "ś".

    Curiously enough thou, JS can still tell you if Alt was pressed at the same time. (So AltGr = Ctrl + Alt.) To cut the long story short: it was enough to add an altDown flag to umbracoCheckKeys.js, set the flag in umbracoCheckKeys(e), and alter checks for ctrlDown in shortcutCheckKeysPressFirefox(e) and runShortCuts() to read "if (ctrlDown && !altDown)" in place of simply "if (ctrlDown)". Done and solved!

  • Marek 3 posts 23 karma points
    Sep 19, 2011 @ 15:36
    Marek
    0

    Hi,

    I have exactly the same problem with my Umbraco installation, version 4.7.

    I did the steps you described, unfortunately there is no difference... Umbraco still doesn't allow me to enter "" (right alt + s).

    Could you please post your umbracoCheckKeys.js file?

    Thanks,
    Marek

  • Jacek 1 post 21 karma points
    Jan 07, 2013 @ 12:45
    Jacek
    0

    Hi,

     I have the same issue. I have tried changing umbracoCheckKeys.js but changes are not shown on the site, ie. when I inspect executed js, I see my changes arent shown. I have:

    • republished whole site,
    • deleted App_Data\TEMP\ClientDependency\* 
    EDIT: I have managed to solve this problem - changing config\ClientDependency.config from:
    <clientDependency version="1" fileDependencyExtensions=".js,.css"> 
    <clientDependency version="2" fileDependencyExtensions=".js,.css">
    Not sure if it is the correct way of doing this... but now everything seems to work :)
    My umbracoCheckKeys.js file:
    var ctrlDown = false;
    var shiftDown = false;
    var keycode = 0
    
    var currentRichTextDocument = null;
    var currentRichTextObject = null;
    
    function umbracoCheckKeysUp(e) {
        ctrlDown = e.ctrlKey;
        shiftDown = e.shiftKey;
    }
    
    function umbracoActivateKeys(ctrl, shift, key) {
        ctrlDown = ctrl && !e.altKey;
        shiftDown = shift;
        keycode = key
        return runShortCuts();
    }
    
    function umbracoActivateKeysUp(ctrl, shift, key) {
        ctrlDown = ctrl;
        shiftDown = shift;
        keycode = key;
    }
    
    function umbracoCheckKeys(e) {
        ctrlDown = e.ctrlKey && !e.altKey;
        shiftDown = e.shiftKey;
        keycode = e.keyCode;
    
        return runShortCuts();
    }
    
    function shortcutCheckKeysPressFirefox(e) {
            if (ctrlDown && !altDown && keycode == 83)
                e.preventDefault();
    }
    
    
    function runShortCuts() {
        if (currentRichTextObject != undefined && currentRichTextObject != null) {
            if (ctrlDown && !altDown) {
                if (!shiftDown && keycode == 9) 
                    functionsFrame.tabSwitch(1);
                else
                    if (shiftDown && keycode == 9) functionsFrame.tabSwitch(-1);
    
                if (keycode == 83) {doSubmit(); return false;}
                if (shiftDown && currentRichTextObject) {
                    if (keycode == 70) {functionsFrame.umbracoInsertForm(myAlias); return false;}
                    if (keycode == 76) {functionsFrame.umbracoLink(myAlias); return false;}
                    if (keycode == 77) {functionsFrame.umbracoInsertMacro(myAlias, umbracoPath); return false;}
                    if (keycode == 80) {functionsFrame.umbracoImage(myAlias); return false;}
                    if (keycode == 84) {functionsFrame.umbracoInsertTable(myAlias); return false;}
                    if (keycode == 86) {functionsFrame.umbracoShowStyles(myAlias); return false;}
                    if (keycode == 85) {functionsFrame.document.getElementById('TabView1_tab01layer_publish').click(); return false;}
                }
            } 
    
        } else 
            if (isDialog) {
                if (keycode == 27) {window.close();} // ESC
                if (keycode == 13 && functionsFrame.submitOnEnter != undefined) {
                    if (!functionsFrame.disableEnterSubmit) {
                        if (functionsFrame.submitOnEnter) {
                         // firefox hack
                         if (window.addEventListener)
                            e.preventDefault();
                         doSubmit();
                        }
                    }
                }
                if (ctrlDown && !altDown) {
                    if (keycode == 83)
                        doSubmit();
                    else if (keycode == 85)
                        document.getElementById('TabView1_tab01layer_publish').click();
                    else if (!shiftDown && keycode == 9) {
                        functionsFrame.tabSwitch(1);
                        return false;
                    }
                    else
                        if (shiftDown && keycode == 9) {
                            functionsFrame.tabSwitch(-1);
                            return false;
                        }
    
                }
            }
    
            return true;
    
    }
    
    if (window.addEventListener) {
        document.addEventListener('keyup', umbracoCheckKeysUp, false);
        document.addEventListener('keydown', umbracoCheckKeys, false);
        document.addEventListener('keypress', shortcutCheckKeysPressFirefox, false);
    } else {
        document.attachEvent( "onkeyup", umbracoCheckKeysUp);
        document.attachEvent("onkeydown", umbracoCheckKeys);            
    }

Please Sign in or register to post replies

Write your reply to:

Draft