source: temp/trunk/html/drecomcms/access_key.js @ 1328

Revision 1328, 1.0 KB checked in by naka, 20 years ago (diff)

* empty log message *

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/*
2 * Access Key Utilities
3 *
4 *
5 * Copyright (c) 2003-2004 DRECOM CO.,LTD. All rights reserved.
6 *
7 * [email protected]
8 * http://www.drecom.co.jp/
9 */
10
11/**
12 * •Û‘¶ƒVƒ‡[ƒgƒJƒbƒg‚ð—LŒø‚É‚·‚é‚©‚Ç‚¤‚©B
13 * ƒVƒ‡[ƒgƒJƒbƒg‚æ‚è‚àæ‚ɁAƒuƒ‰ƒEƒU‚̕ۑ¶ƒ_ƒCƒAƒƒO‚ªo‚éê‡‚Í–³Œø‚É‚·‚éB
14 *
15 * @return •Û‘¶ƒVƒ‡[ƒgƒJƒbƒg‚ð—LŒø‚É‚·‚é‚©‚Ç‚¤‚©
16 */
17function shortCutSupported()
18{
19    return (document.all != null && null == XBSUtil.opera);
20}
21
22function access_key_onkeydown_hock(theEvent)
23{
24    if (false == shortCutSupported()) {
25        return true;
26    }
27
28    if (theEvent == null) {
29        theEvent = window.event;
30    }
31    var willCancel = false;
32    var k = XBSEvent.getKeyCode(theEvent);
33    var m = XBSEvent.getModifierFlags(theEvent);
34    if (m & XBSEvent.CONTROL_KEY_MASK){
35        if (k == 83) {  // 's'
36            execSave != null ? execSave() : void(0);
37            willCancel = true;
38        }
39    } else if (m & XBSEvent.ALT_KEY_MASK){
40        if (k == 80) {  // 'p'
41            execPrint != null ? execPrint() : void(0);
42            willCancel = true;
43        }
44    }
45    if (willCancel) {
46        theEvent.returnValue = false;
47        return false;
48    }
49   
50    return true;
51}
Note: See TracBrowser for help on using the repository browser.