first_page the funky knowledge base
personal notes from way, _way_ back and maybe today

Microsoft JScript: Handling Keystrokes; jsHandleKeyDown()

//Set event pointers. document.onkeydown = jsHandleKeyDown

//Handle keystrokes. function jsHandleKeyDown() { vFrmName = "" vElementName = ""

if (window.name == "dataEmail") {
    //The keyCode property returns Unicode values.
    switch(event.keyCode){
        case 68://Ctrl + Shift + d
            if(event.ctrlKey == false) return
            window.document.frmEmailData.cmdDelete.click()
            break
        case 83://Ctrl + Shift + s
            if(event.ctrlKey == false) return
            window.document.frmEmailData.cmdSet.click()
            break
    }
}

if (window.name == "dataKB") {
    //The keyCode property returns Unicode values.
    switch(event.keyCode){
        case 68://Ctrl + Shift + d
            if(event.ctrlKey == false) return
            window.document.frmKBData.cmdDelete.click()
            break
        case 83://Ctrl + Shift + s
            if(event.ctrlKey == false) return
            window.document.frmKBData.cmdSet.click()
            break
    }
}

if (window.name == "dataKPages") {
    //The keyCode property returns Unicode values.
    switch(event.keyCode){
        case 68://Ctrl + Shift + d
            if(event.ctrlKey == false) return
            window.document.frmKPagesData.cmdDelete.click()
            break
        case 83://Ctrl + Shift + s
            if(event.ctrlKey == false) return
            window.document.frmKPagesData.cmdSet.click()
            break
    }
}

if (window.name == "dataKStyles") {
    //The keyCode property returns Unicode values.
    switch(event.keyCode){
        case 68://Ctrl + Shift + d
            if(event.ctrlKey == false) return
            window.document.frmKStylesData.cmdDelete.click()
            break
        case 83://Ctrl + Shift + s
            if(event.ctrlKey == false) return
            window.document.frmKStylesData.cmdSet.click()
            break
    }
}

if (window.name == "dataTable") {
    //The keyCode property returns Unicode values.
    switch(event.keyCode){
        case 37://Alt + Shift + [left arrow]
            if(event.altKey == false) return
            window.document.frmPage.cmdPagePrev.click()
            break
        case 38://Alt + Shift + [up arrow]
            if(event.altKey == false) return
            window.document.frmPage.cmdPageFirst.click()
            break
        case 39://Alt + Shift + [right arrow]
            if(event.altKey == false) return
            window.document.frmPage.cmdPageNext.click()
            break
        case 40://Alt + Shift + [down arrow]
            if(event.altKey == false) return
            window.document.frmPage.cmdPageLast.click()
            break
        case 78://Ctrl + Shift + n
            if(event.ctrlKey == false) return
            window.document.anchors("aNew").click()
            break
        case 80://Ctrl + Shift + p
            if(event.ctrlKey == false) return
            window.document.frmPage.lstPageNo.focus()
            break
        case 83://Ctrl + Shift + s
            if(event.ctrlKey == false) return
            window.document.anchors("aSearch").click()
            break
    }
}

if (window.name == "root") {
    switch(event.keyCode){
        case 13://Enter
            vFrmName = window.document.frm.lstForms.value
            vElementName = vFrmName.replace("frm","cmd")
            window.document.forms[vFrmName].elements[vElementName].click()
            break
        case 76://Ctrl + Shift + l
            if(event.ctrlKey == false) return
            window.document.frm.lstForms.focus()
            break
        case 78://Ctrl + Shift + n
            if(event.ctrlKey == false) return
            window.document.anchors("a_" + window.document.frm.lstForms.value).click()
            break
        case 87://Ctrl + Shift + w
            if(event.ctrlKey == false) return
            window.document.anchors("aWork").click()
            break
    }
}

}

mod date: 2001-02-07T02:17:19.000Z