-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
19 additions
and
8 deletions.
There are no files selected for viewing
6 changes: 3 additions & 3 deletions
6
src/const/KeyAliasesDictionary.js → src/const/KeyOSAndLayoutAliasesDictionary.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
/** | ||
* A dictionary of key aliases to make it easier to specify key maps that work | ||
* across different keyboard layouts and operating systems - this builds on top | ||
* of what React already does | ||
* of what React already does. | ||
*/ | ||
const KeyAliasesDictionary = { | ||
const KeyOSAndLayoutAliasesDictionary = { | ||
'Backspace': [ 'Delete' ], | ||
}; | ||
|
||
export default KeyAliasesDictionary; | ||
export default KeyOSAndLayoutAliasesDictionary; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
/** | ||
* A mapping between key names and official names | ||
*/ | ||
const KeyShorthandDictionary = { | ||
'cmd': 'Meta', | ||
}; | ||
|
||
export default KeyShorthandDictionary; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,12 @@ | ||
import KeyAliasesDictionary from '../../const/KeyAliasesDictionary'; | ||
import KeyOSAndLayoutAliasesDictionary from '../../const/KeyOSAndLayoutAliasesDictionary'; | ||
|
||
/** | ||
* Returns a list of accepted aliases for the specified key | ||
* @param {NormalizedKeyName} keyName Name of the key | ||
* @returns {ReactKeyName[]} List of key aliases | ||
*/ | ||
function resolveKeyAlias(keyName) { | ||
return KeyAliasesDictionary[keyName] || [ keyName ]; | ||
return KeyOSAndLayoutAliasesDictionary[keyName] || [ keyName ]; | ||
} | ||
|
||
export default resolveKeyAlias; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters