-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkeyboard.html
More file actions
109 lines (107 loc) · 16.8 KB
/
keyboard.html
File metadata and controls
109 lines (107 loc) · 16.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Keyboard</title>
<!-- Bootstrap -->
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
<style type="text/css">
.keypadBtn {
}
.rowGap {
margin-top:2px;
margin-bottom:2px;
}
</style>
</head>
<body>
<div class="container">
<div class="row">
<h1>Swype simulator</h1>
</div>
<div class="row">
<label id="result"></label>
</div>
<div class="container">
<label id="results1"></label>
</div>
<div class="row rowGap">
<button type="button" class="btn btn-lg btn-primary keypadBtn">Q</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">W</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">E</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">R</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">T</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">Y</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">U</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">I</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">O</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">P</button>
</div>
<div class="row rowGap">
<button type="button" class="btn btn-lg btn-primary keypadBtn" style="margin-left:20px">A</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">S</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">D</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">F</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">G</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">H</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">J</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">K</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">L</button>
</div>
<div class="row rowGap">
<button type="button" class="btn btn-lg btn-primary keypadBtn" style="margin-left:50px">Z</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">X</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">C</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">V</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">B</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">N</button>
<button type="button" class="btn btn-lg btn-primary keypadBtn">M</button>
</div>
</div>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/js/bootstrap.min.js"></script>
<script src="trie.js"></script>
<script type="text/javascript">
var dictWordsT = new trie(["t.", "t.", "ta", "tab", "tabby", "tabernacle", "table", "tablecloth", "tablespoon", "tablespoonful", "tablet", "table tennis", "tabloid", "taboo", "tabulate", "tabulation", "tacit", "tacitly", "taciturn", "tack", "tackiness", "tackle", "tacky", "taco", "tact", "tactful", "tactfully", "tactic", "tactical", "tactically", "tactics", "tad", "tadpole", "taffy", "tag", "tail", "tailgate", "taillight", "tailor", "tailoring", "tailor-made", "tailpipe", "tails", "tailspin", "taint", "tainted", "taiwanese", "take", "taken", "takeoff", "takeout", "takeover", "taking", "tale", "talent", "talented", "talisman", "talk", "talkative", "talker", "talks", "talk show", "tall", "tallow", "tally", "talmud", "talon", "tambourine", "tame", "tamper", "tampon", "tan", "tandem", "tangent", "tangential", "tangerine", "tangible", "tangle", "tangled", "tango", "tangy", "tank", "tankard", "tanker", "tanned", "tantalize", "tantalizing", "tantalizingly", "tantamount", "tantrum", "tap", "tap dance", "tap-dance", "tape", "tape deck", "tape measure", "tape player", "taper", "tape-record", "tape recorder", "tapered", "tapestry", "tapeworm", "taps", "tap water", "tar", "tarantula", "tardiness", "tardy", "target", "tariff", "tarmac", "tarnish", "tarot", "tarp", "tarpaulin", "tarry", "tart", "tartan", "tartar", "tartar sauce", "task", "task force", "tassel", "taste", "tasteful", "tastefully", "tasteless", "taster", "tasty", "tattered", "tattle", "tattletale", "tattoo", "taught", "taunt", "taurus", "taut", "tautly", "tavern", "tawdry", "tawny", "tax", "taxable", "taxation", "tax-deductible", "tax-exempt", "taxi", "taxidermy", "taxing", "taxi stand", "taxpayer", "tax shelter", "tb", "tbsp.", "tea", "tea bag", "teach", "teacher", "teacher's pet", "teaching", "teaching assistant", "teacup", "teak", "teakettle", "team", "teammate", "team player", "teamster", "teamwork", "teapot", "tear", "teardrop", "tearful", "teargas", "tease", "teaspoon", "teaspoonful", "teat", "technical", "technicality", "technically", "technician", "technique", "technological", "technologist", "technology", "teddy bear", "tedious", "tedium", "tee", "teem", "teen", "teenage", "teenaged", "teenager", "teens", "teeny-weeny", "teeter", "teeter-totter", "teeth", "teethe", "teetotaler", "teflon", "telecommunications", "telecommuter", "telecommuting", "telegram", "telegraph", "telepathy", "telephone", "telephoto lens", "telescope", "telescopic", "telethon", "televise", "television", "tell", "teller", "telling", "telltale", "temp", "temper", "temperament", "temperamental", "temperance", "temperate", "temperature", "tempest", "tempestuous", "template", "temple", "tempo", "temporarily", "temporary", "tempt", "temptation", "tempting", "ten", "tenacious", "tenacity", "tenancy", "tenant", "tend", "tendency", "tender", "tenderhearted", "tenderize", "tenderly", "tenderness", "tendon", "tendril", "tenement", "tenet", "tennis", "tennis shoe", "tenor", "tense", "tension", "tent", "tentacle", "tentative", "tentatively", "tenth", "tenuous", "tenure", "tepee", "tepid", "tequila", "term", "terminal", "terminally", "terminate", "termination", "terminology", "terminus", "termite", "term paper", "terms", "terr.", "terrace", "terra cotta", "terrain", "terrestrial", "terrible", "terribly", "terrier", "terrific", "terrified", "terrify", "terrifying", "territorial", "territory", "terror", "terrorism", "terrorist", "terrorize", "terse", "tersely", "test", "testament", "test ban", "test case", "test drive", "test-drive", "testes", "testicle", "testify", "testimonial", "testimony", "test tube", "testy", "tetanus", "tether", "text", "textbook", "textile", "texture", "than", "thank", "thankful", "thankfully", "thankless", "thanks", "thanksgiving", "thank-you", "that", "thatch", "that's", "thaw", "the", "theater", "theatrical", "theft", "their", "theirs", "them", "thematic", "theme", "theme park", "theme song", "themselves", "then", "theologian", "theological", "theology", "theoretical", "theoretically", "theoretician", "theorist", "theorize", "theory", "therapeutic", "therapist", "therapy", "there", "thereabout", "thereabouts", "thereafter", "thereby", "therefore", "therein", "thereof", "there's", "thereupon", "thermal", "thermometer", "thermonuclear", "thermos", "thermostat", "thesauri", "thesaurus", "these", "theses", "thesis", "they", "they'd", "they'll", "they're", "they've", "thick", "thicken", "thicket", "thickly", "thickness", "thick-skinned", "thief", "thieves", "thigh", "thimble", "thin", "thing", "thingamajig", "things", "think", "thinker", "thinking", "think tank", "thinly", "third", "third degree", "third-degree burn", "third party", "third person", "third-rate", "third world", "thirst", "thirstily", "thirsty", "thirteen", "thirteenth", "thirtieth", "thirty", "this", "thistle", "thong", "thorn", "thorny", "thorough", "thoroughbred", "thoroughfare", "thoroughly", "thoroughness", "those", "though", "thought", "thoughtful", "thoughtfully", "thoughtfulness", "thoughtless", "thoughtlessly", "thoughtlessness", "thousand", "thousandth", "thrash", "thrashing", "thread", "threadbare", "threat", "threaten", "threatening", "threateningly", "three", "three-dimensional", "thresh", "thresher", "threshold", "threw", "thrift", "thrifty", "thrill", "thrilled", "thriller", "thrilling", "thrive", "thriving", "throat", "throaty", "throb", "throne", "throng", "throttle", "through", "throughout", "throve", "throw", "throwaway", "throwback", "thrown", "thrust", "thud", "thug", "thumb", "thumbnail", "thumbtack", "thump", "thunder", "thunderbolt", "thunderous", "thunderstorm", "thunderstruck", "thurs.", "thursday", "thus", "thwart", "thyroid", "tiara", "tic", "tick", "ticket", "tickle", "ticklish", "tick-tack-toe", "tidal", "tidal wave", "tidbit", "tide", "tidy", "tie", "tiebreaker", "tier", "tiff", "tiger", "tight", "tighten", "tightfisted", "tightly", "tightness", "tightrope", "tights", "tightwad", "tile", "till", "tilt", "timber", "time", "time and a half", "time bomb", "time card", "time clock", "time-consuming", "time-honored", "timekeeper", "timeless", "time limit", "timely", "time-out", "timer", "times", "timetable", "time zone", "timid", "timidity", "timidly", "timing", "tin", "tinder", "tinderbox", "tinfoil", "tinge", "tinged", "tingle", "tingling", "tinker", "tinkle", "tinny", "tinsel", "tint", "tiny", "tip", "tip-off", "tipsy", "tiptoe", "tirade", "tire", "tired", "tiredness", "tireless", "tiresome", "tiring", "tissue", "tissue paper", "tit", "titillate", "title", "title role", "titter", "tizzy", "tlc", "tm", "tnt", "to", "toad", "toadstool", "to and fro", "to-and-fro", "toast", "toaster", "toasty", "tobacco", "tobacconist", "toboggan", "today", "toddle", "toddler", "to-do", "toe", "toefl", "toehold", "toenail", "toffee", "tofu", "toga", "together", "togetherness", "toggle", "togs", "toil", "toilet", "toilet paper", "toiletries", "token", "tokenism", "told", "tolerable", "tolerance", "tolerant", "tolerate", "toll", "tollbooth", "toll-free", "tollgate", "tomahawk", "tomato", "tomb", "tomboy", "tombstone", "tomcat", "tome", "tomfoolery", "tomorrow", "ton", "tone", "tone-deaf", "tongs", "tongue", "tongue-in-cheek", "tongue-tied", "tongue twister", "tonic", "tonic water", "tonight", "tonnage", "tons", "tonsil", "tonsillitis", "too", "took", "tool", "toolbar", "toot", "tooth", "toothache", "toothbrush", "toothpaste", "toothpick", "top", "top hat", "top-heavy", "topic", "topical", "topic sentence", "topless", "top-notch", "topographer", "topography", "topping", "topple", "top-secret", "topsy-turvy", "torch", "tore", "torment", "tormentor", "torn", "tornado", "torpedo", "torrent", "torrential", "torrid", "torso", "tort", "tortilla", "tortoise", "tortuous", "torture", "torturer", "toss", "toss-up", "tot", "total", "totalitarian", "totalitarianism", "totality", "totally", "tote", "totem pole", "totter", "toucan", "touch", "touch-and-go", "touchdown", "touched", "touching", "touchstone", "touchy", "tough", "toughen", "toughness", "toupee", "tour", "tourism", "tourist", "tournament", "tourniquet", "tousle", "tout", "tow", "toward", "towards", "towel", "tower", "towering", "town", "town hall", "townhouse", "township", "tow truck", "toxic", "toxicity", "toxicology", "toxin", "toy", "trace", "tracer", "track", "track and field", "track meet", "track record", "tract", "traction", "tractor", "tractor-trailer", "trade", "trade-in", "trademark", "trade-off", "trader", "trade school", "trade secret", "tradition", "traditional", "traditionalist", "traditionally", "traffic", "traffic jam", "traffic light", "tragedy", "tragic", "tragically", "trail", "trailblazer", "trailer", "trailer park", "train", "trained", "trainee", "trainer", "training", "trait", "traitor", "trajectory", "tramp", "/li>", "trampoline", "trance", "tranquil", "tranquility", "tranquilize", "tranquilizer", "transact", "transaction", "transatlantic", "transcend", "transcendence", "transcendental", "transcontinental", "transcribe", "transcript", "transcription", "transfer", "transferable", "transform", "transformation", "transformer", "transfusion", "transgress", "transgression", "transient", "transistor", "transit", "transition", "transitional", "transitive", "transitory", "translate", "translation", "translator", "translucence", "translucent", "transmission", "transmit", "transmitter", "transparency", "transparent", "transparently", "transpire", "transplant", "transport", "transportation", "transpose", "transsexual", "transvestite", "trap", "trap door", "trapeze", "trapper", "trappings", "trash", "trash can", "trashy", "trauma", "traumatic", "traumatize", "travel", "travel agency", "travel agent", "traveler", "traveler's check", "travels", "traverse", "travesty", "trawl", "trawler", "tray", "treacherous", "treachery", "tread", "treadmill", "treason", "treasure", "treasurer", "treasury", "treat", "treatable", "treatise", "treatment", "treaty", "treble", "tree", "treetop", "trek", "trellis", "tremble", "tremendous", "tremendously", "tremor", "trench", "trenchant", "trench coat", "trend", "trendy", "trepidation", "trespass", "trespasser", "trestle", "trial", "trial run", "trials", "triangle", "triangular", "tribal", "tribe", "tribulation", "tribunal", "tributary", "tribute", "triceps", "trick", "trickery", "trickle", "trick or treat", "trickster", "tricky", "tricycle", "trident", "trifle", "trifling", "trigger", "trigger-happy", "trigonometry", "trike", "trill", "trillion", "trilogy", "trim", "trimester", "trimmings", "trinity", "trinket", "trio", "trip", "tripe", "triple", "triplet", "triplicate", "tripod", "trite", "triumph", "triumphant", "triumphantly", "trivia", "trivial", "trivialize", "trod", "trodden", "troll", "trolley", "trombone", "tromp", "troop", "trooper", "troops", "trophy", "tropic", "tropical", "tropics", "trot", "troubadour", "trouble", "troubled", "troublemaker", "troubleshooter", "troubleshooting", "troublesome", "trough", "trounce", "troupe", "trousers", "trout", "truancy", "truant", "truce", "truck", "trucker", "trucking", "truckload", "truck stop", "truculent", "trudge", "true", "truffle", "truism", "truly", "trump", "trumped-up", "trumpet", "trumpeter", "truncated", "trundle", "trunk", "trunks", "trust", "trustee", "trustful", "trusting", "trustworthy", "truth", "truthful", "truthfully", "try", "trying", "tryout", "t-shirt", "tsp.", "tub", "tuba", "tubby", "tube", "tuberculosis", "tubing", "tubular", "tuck", "tues.", "tuesday", "tuft", "tufted", "tug", "tugboat", "tug of war", "tuition", "tulip", "tumble", "tumbler", "tummy", "tumor", "tumult", "tumultuous", "tuna", "tundra", "tune", "tuner", "tune-up", "tunic", "tunnel", "turban", "turbine", "turbulence", "turbulent", "turd", "tureen", "turf", "turgid", "turkey", "turmoil", "turn", "turnaround", "turncoat", "turning point", "turnip", "turn-off", "turnout", "turnover", "turnpike", "turn signal", "turnstile", "turntable", "turpentine", "turquoise", "turret", "turtle", "turtleneck", "tush", "tusk", "tussle", "tutor", "tutorial", "tutoring", "tux", "tuxedo", "tv", "tv dinner", "twang", "tweak", "tweed", "tweet", "tweezers", "twelfth", "twelve", "twentieth", "twenty", "twenty-one", "twerp", "twice", "twiddle", "twig", "twilight", "twin", "twin bed", "twine", "twinge", "twinkle", "twin-size", "twirl", "twist", "twisted", "twister", "twit", "twitch", "twitter", "two", "two-bit", "two-dimensional", "two-faced", "two-piece", "two-tone", "tycoon", "tyke", "tylenol", "type", "typecast", "typeface", "typewriter", "typewritten", "typhoid", "typhoon", "typical", "typically", "typify", "typing", "typist", "typo", "tyrannical", "tyrannize", "tyranny", "tyrant"]);
function UserInputRecorder() {
this.isActionInProgress = false;
this.userInput = '';
this.appendInput = function(swipeChar) {
this.userInput += swipeChar;
};
this.resetInput = function() {
this.userInput = '';
};
}
var testRecorder = new UserInputRecorder();
$('.keypadBtn').mousedown(function () {
testRecorder.isActionInProgress = true;
testRecorder.resetInput();
testRecorder.appendInput($(this).text());
$("#result").text(testRecorder.userInput);
$("#result1").text('');
});
$('.keypadBtn').mouseup(function () {
testRecorder.isActionInProgress = false;
var result = dictWordsT.getLegalWords(testRecorder.userInput.toLowerCase());
$("#results1").text(result.join());
});
$('.keypadBtn').mouseover(function () {
if(testRecorder.isActionInProgress) {
testRecorder.appendInput($(this).text());
$("#result").text(testRecorder.userInput);
}
});
</script>
</body>
</html>