From dae68d32e9d2323a6fca0a909621353b24b85dc4 Mon Sep 17 00:00:00 2001 From: Cesar Ibarra Date: Sat, 6 Jul 2019 17:15:59 -0700 Subject: [PATCH] Remove uncessary util files --- src/components/Keyboard.js | 7 ++- src/utils/index.js | 3 - src/utils/keyboard.js | 43 +++++++++++++++ src/utils/keyboardUtils.js | 110 ------------------------------------- 4 files changed, 48 insertions(+), 115 deletions(-) delete mode 100644 src/utils/index.js create mode 100644 src/utils/keyboard.js delete mode 100644 src/utils/keyboardUtils.js diff --git a/src/components/Keyboard.js b/src/components/Keyboard.js index a265ab53b..fcdc09dde 100644 --- a/src/components/Keyboard.js +++ b/src/components/Keyboard.js @@ -1,7 +1,10 @@ import React, { Component } from 'react'; -import { shiftedKeys, mapToSpecialKeys, specialKeyNames } from "../utils/keyboardUtils"; -import { isAlpha } from '../utils'; +import { shiftedKeys, mapToSpecialKeys, specialKeyNames } from "../utils/keyboard"; + +function isAlpha(ch) { + return ch.match(/^[a-z]+$/i) !== null; +} class Keyboard extends Component { diff --git a/src/utils/index.js b/src/utils/index.js deleted file mode 100644 index bf930ff93..000000000 --- a/src/utils/index.js +++ /dev/null @@ -1,3 +0,0 @@ -export const isAlpha = ch => { - return ch.match(/^[a-z]+$/i) !== null; -} \ No newline at end of file diff --git a/src/utils/keyboard.js b/src/utils/keyboard.js new file mode 100644 index 000000000..8e2e8270d --- /dev/null +++ b/src/utils/keyboard.js @@ -0,0 +1,43 @@ +/* + * Maps user key input values to whatever class + * is going to be used to highlight the keys + * they should be typing with. + * From #typephil 1.0 +*/ + export const mapToSpecialKeys = { + "~": "`", + "!": "1", + "@": "2", + "#": "3", + "$": "4", + "%": "5", + "^": "6", + "&": "7", + "*": "8", + "(": "9", + ")": "0", + "_": "-", + "+": "=", + "|": "\\", + "{": "[", + "}": "]", + ":": ";", + '"': "'", + "<": ",", + ">": ".", + "?": "/" + }; + +export const specialKeyNames = { + ";": "semicolon", + "[": "bracket-r", + "]": "bracket-l", + "`": "tick", + "=": "equal", + "-": "minus", + "/": "f-slash", + ".": "period", + ",": "comma" +} + + export const shiftedKeys = ["~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "+", "|", "{", "}", ":", '"', "<", "?"] diff --git a/src/utils/keyboardUtils.js b/src/utils/keyboardUtils.js deleted file mode 100644 index 63721a216..000000000 --- a/src/utils/keyboardUtils.js +++ /dev/null @@ -1,110 +0,0 @@ - -/* - * Maps user key input values to whatever class - * is going to be used to highlight the keys - * they should be typing with. - * From #typephil 1.0 -*/ - -//caps-lock, shift-r, shift-l, cmd, tab, bracket-r, alt, tilde, plus, delete, minus, comma, period -//apostrephe -const fingerHighlightMap = { - "A": "finger-1 finger-10", - "a": "finger-1", - "B": "finger-10 finger-4", - "b": "finger-4", - "C": "finger-4 finger-10", - "c": "finger-4", - "D": "finger-3 finger-10", - "d": "finger-3", - "E": "finger-3 finger-10", - "e": "finger-3", - "F": "finger-4 finger-10", - "f": "finger-4", - "G": "finger-4 finger-10", - "g": "finger-4", - "H": "finger-1 finger-7", - "h": "finger-7", - "I": "finger-8 finger-1", - "i": "finger-8", - "J": "finger-7 finger-1", - "j": "finger-7", - "K": "finger-8 finger-1", - "k": "finger-8", - "L": "finger-1 finger-9", - "l": "finger-9", - "M": "finger-1 finger-7", - "m": "finger-7", - "N": "finger-1 finger-7", - "n": "finger-7", - "O": "finger-1 finger-9", - "o": "finger-9", - "P": "finger-1 finger-10", - "p": "finger-10", - "Q": "finger-1 finger-10", - "q": "finger-1", - "R": "finger-10 finger-4", - "r": "finger-4", - "S": "finger-2 finger-10", - "s": "finger-2", - "T": "finger-10 finger-4", - "t": "finger-4", - "U": "finger-1 finger-7", - "u": "finger-7", - "V": "finger-10 finger-4", - "v": "finger-4", - "W": "finger-10 finger-2", - "w": "finger-2", - "X": "finger-10 finger-3", - "x": "finger-3", - "Y": "finger-1 finger-7", - "y": "finger-7", - "Z": "finger-1 finger-10", - "z": "finger-1", - " ": "finger-6", - "comma": "finger-8", - "period": "finger-10", - "apostrophe": "finger-10", - "semicolon": "finger-10", - "f-slash": "finger-10", - "questionmark": "finger-1 finger-10", - "exclamationmark": "finger-3, finger-10" - }; - - export const mapToSpecialKeys = { - "~": "`", - "!": "1", - "@": "2", - "#": "3", - "$": "4", - "%": "5", - "^": "6", - "&": "7", - "*": "8", - "(": "9", - ")": "0", - "_": "-", - "+": "=", - "|": "\\", - "{": "[", - "}": "]", - ":": ";", - '"': "'", - "<": ",", - ">": ".", - "?": "/" - }; - -export const specialKeyNames = { - ";": "semicolon", - "[": "bracket-r", - "]": "bracket-l", - "`": "tick", - "=": "equal", - "-": "minus", - "/": "f-slash", - ".": "period", - ",": "comma" -} - - export const shiftedKeys = ["~", "!", "@", "#", "$", "%", "^", "&", "*", "(", ")", "_", "+", "|", "{", "}", ":", '"', "<", "?"] \ No newline at end of file