-
Notifications
You must be signed in to change notification settings - Fork 1
/
eventkey.js
24 lines (24 loc) · 1017 Bytes
/
eventkey.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
//Contribute with Nikhil Singh
document.onkeypress=function(event){
keyCode = event.keyCode;
switch(keyCode){
case 103:
window.open('https://www.google.com/search?q=' + window.getSelection().toString(), '_blank');
break;
case 71:
window.open('https://www.google.com/search?q=' + window.getSelection().toString(), '_blank');
break;
case 121:
window.open('https://www.youtube.com/results?search_query=' + window.getSelection().toString(), '_blank');
break;
case 89:
window.open('https://www.youtube.com/results?search_query=' + window.getSelection().toString(), '_blank');
break;
case 100:
window.open('https://duckduckgo.com/?q=' + window.getSelection().toString(), '_blank');
break;
case 68:
window.open('https://duckduckgo.com/?q=' + window.getSelection().toString(), '_blank');
break;
}
};