Invoke Save button when Ctrl + S button is clicked

Version 1

    <ui:composition>
        <c:set var="summaryBtnId" value="${empty id ? 'save': id}"/>

     

    <a4j:commandButton id="${empty id ? 'save': id}" value="Save Changes" action="#{action.toString}" reRender="#{reRender}"
                           onclick="removeSpacesFromInputFields(); if (!checkMandatoryForVisible()){return false}"/>

     

    .

    .

    .

    .

    .

    .

    .

     

    <ui:remove>
            The below script is added to invoke the Save Changes button when the user clicks Ctrl + S  
        </ui:remove>

     

        <script type="text/javascript">
            var isCtrl = false;
            document.onkeyup=function(e){
                var e=window.event || e ;
                var keyunicode=e.charCode || e.keyCode;
                if(keyunicode == 17) isCtrl=false;
            }
            document.onkeydown=function(e){
                var e=window.event || e ;
                var keyunicode=e.charCode || e.keyCode;
                if(keyunicode == 17) isCtrl=true;
                if(keyunicode == 83) {
                    if(isCtrl == true){
                        document.getElementById('#{rich:clientId(summaryBtnId)}').click();
                        return false;
                    }
                }
            }
        </script>
    </ui:composition>