|
STools | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object | +--SKeyShortcut
Defined in SKeyShortcut.js
Version: 1.0
Author: deltapositive (deltapositive@yahoo.fr)
Field Summary | |
<static> string |
ALT_KEY_MODIFIER
This constant defines the ALT key prefix in a key sequence. |
<static> string |
CTRL_KEY_MODIFIER
This constant defines the CTRL key prefix in a key sequence. |
<static> string |
ESCAPE_KEY
This constant defines the ESCAPE key code in a key sequence. |
<static> string |
FUNCTION_PREFIX_KEY
This constant defines the prefix of the functions key (F1 to F12) code in a key sequence. |
<static> string |
RETURN_KEY
This constant defines the RETURN key code in a key sequence. |
<static> string |
SHIFT_KEY_MODIFIER
This constant defines the SHIFT key prefix in a key sequence. |
Constructor Summary | |
SKeyShortcut
()
SKeyShortcut is part of the STools. Copyright 2005 STools Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. SKeyShortcut is a class that creates an association between a key (or an association of key) and a javascript function. Basic usage : This class is usefull to get the user pressed 'Return' to close a dialog box. This class is used in a menu to associate a shortcut to an item. |
Method Summary | |
Object
|
getParameter(<string> name)
Get a parameter's value |
void
|
setEventListener(<string> event, <function> listener)
Set a listener for an event. |
void
|
setKeySequence(<string> sequence)
Set the key sequence for the shortcut For example: SKeyShortcut.FUNCTION_PREFIX_KEY + '3' assign a shortcut for the F3 key A sequence is defined by zero, one or more modifier (from Ctrl, Alt and Shift) and a key. |
void
|
setParameter(<string> name, <Object> value)
Set a parameter |
Field Detail |
<static> string ALT_KEY_MODIFIER
<static> string CTRL_KEY_MODIFIER
<static> string ESCAPE_KEY
<static> string FUNCTION_PREFIX_KEY
<static> string RETURN_KEY
<static> string SHIFT_KEY_MODIFIER
Constructor Detail |
SKeyShortcut()
Method Detail |
Object getParameter(<string> name)
name
- The name of the parameter to get.
void setEventListener(<string> event, <function> listener)
event
- The name of the event to listen among: boolean function (skeyshortcut, event)
,boolean function (skeyshortcut, event)
,listener
- The function to call if corresponding event is fired.
void setKeySequence(<string> sequence)
sequence
- The sequence to bind.
void setParameter(<string> name, <Object> value)
name
- The name of the parameter to set.
value
- The value of the parameter.
|
STools | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |