JavaScript Library to show tooltips with keyboard shortcuts when holding down alt/ctrl
up vote
2
down vote
favorite
Is there a JavaScript library that, when the user holds down ctrl/alt, will display tooltips over elements on the page that have associated keyboard shortcuts (via an accesskey
attribute) that use that key?
ctrl
javascript accessibility
migrated from webapps.stackexchange.com Jul 13 '12 at 14:58
This question came from our site for power users of web applications.
add a comment |
up vote
2
down vote
favorite
Is there a JavaScript library that, when the user holds down ctrl/alt, will display tooltips over elements on the page that have associated keyboard shortcuts (via an accesskey
attribute) that use that key?
ctrl
javascript accessibility
migrated from webapps.stackexchange.com Jul 13 '12 at 14:58
This question came from our site for power users of web applications.
1
A browser extension perhaps? Rather than a "JavaScript library"...? Or is this something you wish to apply to your own website? When you refer to "associated keyboard shortcuts", are you referring to AccessKeys, or something more?
– MrWhite
Jul 10 '12 at 16:13
It's a web app, and it probably would have to work with AccessKeys
– Sam Hasler
Jul 10 '12 at 16:15
@w3d Thanks for the AccessKeys hint. I was able to find something that does what I'm after.
– Sam Hasler
Jul 10 '12 at 16:23
Are you wanting to do this for your site or do it within your browser? I know Opera does this automatically.
– Ryan B
Jul 13 '12 at 17:14
@RyanB this is a for a B2B web app.
– Sam Hasler
Jul 18 '12 at 9:20
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
Is there a JavaScript library that, when the user holds down ctrl/alt, will display tooltips over elements on the page that have associated keyboard shortcuts (via an accesskey
attribute) that use that key?
ctrl
javascript accessibility
Is there a JavaScript library that, when the user holds down ctrl/alt, will display tooltips over elements on the page that have associated keyboard shortcuts (via an accesskey
attribute) that use that key?
ctrl
javascript accessibility
javascript accessibility
edited Nov 20 at 9:39
asked Jul 10 '12 at 15:34
Sam Hasler
10.9k85898
10.9k85898
migrated from webapps.stackexchange.com Jul 13 '12 at 14:58
This question came from our site for power users of web applications.
migrated from webapps.stackexchange.com Jul 13 '12 at 14:58
This question came from our site for power users of web applications.
1
A browser extension perhaps? Rather than a "JavaScript library"...? Or is this something you wish to apply to your own website? When you refer to "associated keyboard shortcuts", are you referring to AccessKeys, or something more?
– MrWhite
Jul 10 '12 at 16:13
It's a web app, and it probably would have to work with AccessKeys
– Sam Hasler
Jul 10 '12 at 16:15
@w3d Thanks for the AccessKeys hint. I was able to find something that does what I'm after.
– Sam Hasler
Jul 10 '12 at 16:23
Are you wanting to do this for your site or do it within your browser? I know Opera does this automatically.
– Ryan B
Jul 13 '12 at 17:14
@RyanB this is a for a B2B web app.
– Sam Hasler
Jul 18 '12 at 9:20
add a comment |
1
A browser extension perhaps? Rather than a "JavaScript library"...? Or is this something you wish to apply to your own website? When you refer to "associated keyboard shortcuts", are you referring to AccessKeys, or something more?
– MrWhite
Jul 10 '12 at 16:13
It's a web app, and it probably would have to work with AccessKeys
– Sam Hasler
Jul 10 '12 at 16:15
@w3d Thanks for the AccessKeys hint. I was able to find something that does what I'm after.
– Sam Hasler
Jul 10 '12 at 16:23
Are you wanting to do this for your site or do it within your browser? I know Opera does this automatically.
– Ryan B
Jul 13 '12 at 17:14
@RyanB this is a for a B2B web app.
– Sam Hasler
Jul 18 '12 at 9:20
1
1
A browser extension perhaps? Rather than a "JavaScript library"...? Or is this something you wish to apply to your own website? When you refer to "associated keyboard shortcuts", are you referring to AccessKeys, or something more?
– MrWhite
Jul 10 '12 at 16:13
A browser extension perhaps? Rather than a "JavaScript library"...? Or is this something you wish to apply to your own website? When you refer to "associated keyboard shortcuts", are you referring to AccessKeys, or something more?
– MrWhite
Jul 10 '12 at 16:13
It's a web app, and it probably would have to work with AccessKeys
– Sam Hasler
Jul 10 '12 at 16:15
It's a web app, and it probably would have to work with AccessKeys
– Sam Hasler
Jul 10 '12 at 16:15
@w3d Thanks for the AccessKeys hint. I was able to find something that does what I'm after.
– Sam Hasler
Jul 10 '12 at 16:23
@w3d Thanks for the AccessKeys hint. I was able to find something that does what I'm after.
– Sam Hasler
Jul 10 '12 at 16:23
Are you wanting to do this for your site or do it within your browser? I know Opera does this automatically.
– Ryan B
Jul 13 '12 at 17:14
Are you wanting to do this for your site or do it within your browser? I know Opera does this automatically.
– Ryan B
Jul 13 '12 at 17:14
@RyanB this is a for a B2B web app.
– Sam Hasler
Jul 18 '12 at 9:20
@RyanB this is a for a B2B web app.
– Sam Hasler
Jul 18 '12 at 9:20
add a comment |
3 Answers
3
active
oldest
votes
up vote
1
down vote
This is what I was looking for: KeyCandy. Although I'll have to fix the flicker when Ctrl is held down.
I knew I'd seen something like this before. Not sure if it's the same one. Anyone got a better one?
FWIW 2 issues: 1- The keyCandy Demo does not seem to work in IE8. 2- be very careful relying on accessKeys, browser hotkeys overrule AccessKeys, and if the user is using assistive technology, then those have precident. The UK Gov standard is the closest thing to a standard set of AccessKeys.
– Ryan B
Jul 13 '12 at 17:08
add a comment |
up vote
0
down vote
accepted
I think KeyTips is the one I'd seen before. It's certainly looks better than KeyCandy, although I like how KeyCandy makes Ctrl the modifier for accesskeys.
Here's what it looks like:
There are some issues with browser reserved shortcuts but as this is an internal intranet site if I make it a hosted app for chrome it would be able to handle any shortcut
add a comment |
up vote
-1
down vote
You don't require any library for keyboard shortcuts. Simply use the keys in the Object passed in the keydown object. For instance:
var element = document.querySelector("#element");
element.addEventListener("keydown", function (event) {
//Ctrl+Alt+Del
if (event.key === "Delete" && event.ctrlKey === true && event.altKey === true) {
//Disables Ctrl+Alt+Del
event.preventDefault();
alert("You pressed Ctrl+Alt+Del, too bad!");
}
//Win+R (On Windows, it opens up the Run Prompt)
else if (event.key === "r" && event.metaKey === true) {
//Disable it once again
event.preventDefault();
alert("You can never 'run' from me!!");
}
//Create A Save Prompt When Users Ctrl+S
else if (event.key === "s" && event.ctrlKey === true) {
event.preventDefault();
//Give The User Options
alert("First choose an option to save, then continue.");
}
});
And then, from there, simply add the title
attribute to the element, to create a browser generated tooltip, and simply focus()
on the element when the shortcut is pressed.
JavaScript:
var element = document.querySelector("#element");
if (event.key === "h" && event.ctrlKey === true) {
event.preventDefault();
element.focus();
}
HTML:
<p title="help section" id="element">Help Help Help<p>
Hope that helps!
This down't answer the question. The question was how do you show a tooltip beside all elements that have a shortcut (via anaccesskey
attribute) when thectrl
/alt
key is held down.
– Sam Hasler
Nov 20 at 9:40
@SamHasler I changed my answer, please revise it once more.
– Da Mahdi03
Nov 20 at 9:49
Sorry, that still doesn't answer the question. I wanted something that would show all possible shortcuts whenCtrl
was held down. I'm happy with KeyTips (see the image I've added to the answer).
– Sam Hasler
Nov 21 at 13:26
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
This is what I was looking for: KeyCandy. Although I'll have to fix the flicker when Ctrl is held down.
I knew I'd seen something like this before. Not sure if it's the same one. Anyone got a better one?
FWIW 2 issues: 1- The keyCandy Demo does not seem to work in IE8. 2- be very careful relying on accessKeys, browser hotkeys overrule AccessKeys, and if the user is using assistive technology, then those have precident. The UK Gov standard is the closest thing to a standard set of AccessKeys.
– Ryan B
Jul 13 '12 at 17:08
add a comment |
up vote
1
down vote
This is what I was looking for: KeyCandy. Although I'll have to fix the flicker when Ctrl is held down.
I knew I'd seen something like this before. Not sure if it's the same one. Anyone got a better one?
FWIW 2 issues: 1- The keyCandy Demo does not seem to work in IE8. 2- be very careful relying on accessKeys, browser hotkeys overrule AccessKeys, and if the user is using assistive technology, then those have precident. The UK Gov standard is the closest thing to a standard set of AccessKeys.
– Ryan B
Jul 13 '12 at 17:08
add a comment |
up vote
1
down vote
up vote
1
down vote
This is what I was looking for: KeyCandy. Although I'll have to fix the flicker when Ctrl is held down.
I knew I'd seen something like this before. Not sure if it's the same one. Anyone got a better one?
This is what I was looking for: KeyCandy. Although I'll have to fix the flicker when Ctrl is held down.
I knew I'd seen something like this before. Not sure if it's the same one. Anyone got a better one?
edited Jul 18 '12 at 8:59
answered Jul 10 '12 at 16:25
Sam Hasler
10.9k85898
10.9k85898
FWIW 2 issues: 1- The keyCandy Demo does not seem to work in IE8. 2- be very careful relying on accessKeys, browser hotkeys overrule AccessKeys, and if the user is using assistive technology, then those have precident. The UK Gov standard is the closest thing to a standard set of AccessKeys.
– Ryan B
Jul 13 '12 at 17:08
add a comment |
FWIW 2 issues: 1- The keyCandy Demo does not seem to work in IE8. 2- be very careful relying on accessKeys, browser hotkeys overrule AccessKeys, and if the user is using assistive technology, then those have precident. The UK Gov standard is the closest thing to a standard set of AccessKeys.
– Ryan B
Jul 13 '12 at 17:08
FWIW 2 issues: 1- The keyCandy Demo does not seem to work in IE8. 2- be very careful relying on accessKeys, browser hotkeys overrule AccessKeys, and if the user is using assistive technology, then those have precident. The UK Gov standard is the closest thing to a standard set of AccessKeys.
– Ryan B
Jul 13 '12 at 17:08
FWIW 2 issues: 1- The keyCandy Demo does not seem to work in IE8. 2- be very careful relying on accessKeys, browser hotkeys overrule AccessKeys, and if the user is using assistive technology, then those have precident. The UK Gov standard is the closest thing to a standard set of AccessKeys.
– Ryan B
Jul 13 '12 at 17:08
add a comment |
up vote
0
down vote
accepted
I think KeyTips is the one I'd seen before. It's certainly looks better than KeyCandy, although I like how KeyCandy makes Ctrl the modifier for accesskeys.
Here's what it looks like:
There are some issues with browser reserved shortcuts but as this is an internal intranet site if I make it a hosted app for chrome it would be able to handle any shortcut
add a comment |
up vote
0
down vote
accepted
I think KeyTips is the one I'd seen before. It's certainly looks better than KeyCandy, although I like how KeyCandy makes Ctrl the modifier for accesskeys.
Here's what it looks like:
There are some issues with browser reserved shortcuts but as this is an internal intranet site if I make it a hosted app for chrome it would be able to handle any shortcut
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
I think KeyTips is the one I'd seen before. It's certainly looks better than KeyCandy, although I like how KeyCandy makes Ctrl the modifier for accesskeys.
Here's what it looks like:
There are some issues with browser reserved shortcuts but as this is an internal intranet site if I make it a hosted app for chrome it would be able to handle any shortcut
I think KeyTips is the one I'd seen before. It's certainly looks better than KeyCandy, although I like how KeyCandy makes Ctrl the modifier for accesskeys.
Here's what it looks like:
There are some issues with browser reserved shortcuts but as this is an internal intranet site if I make it a hosted app for chrome it would be able to handle any shortcut
edited Nov 21 at 13:23
answered Jul 18 '12 at 9:19
Sam Hasler
10.9k85898
10.9k85898
add a comment |
add a comment |
up vote
-1
down vote
You don't require any library for keyboard shortcuts. Simply use the keys in the Object passed in the keydown object. For instance:
var element = document.querySelector("#element");
element.addEventListener("keydown", function (event) {
//Ctrl+Alt+Del
if (event.key === "Delete" && event.ctrlKey === true && event.altKey === true) {
//Disables Ctrl+Alt+Del
event.preventDefault();
alert("You pressed Ctrl+Alt+Del, too bad!");
}
//Win+R (On Windows, it opens up the Run Prompt)
else if (event.key === "r" && event.metaKey === true) {
//Disable it once again
event.preventDefault();
alert("You can never 'run' from me!!");
}
//Create A Save Prompt When Users Ctrl+S
else if (event.key === "s" && event.ctrlKey === true) {
event.preventDefault();
//Give The User Options
alert("First choose an option to save, then continue.");
}
});
And then, from there, simply add the title
attribute to the element, to create a browser generated tooltip, and simply focus()
on the element when the shortcut is pressed.
JavaScript:
var element = document.querySelector("#element");
if (event.key === "h" && event.ctrlKey === true) {
event.preventDefault();
element.focus();
}
HTML:
<p title="help section" id="element">Help Help Help<p>
Hope that helps!
This down't answer the question. The question was how do you show a tooltip beside all elements that have a shortcut (via anaccesskey
attribute) when thectrl
/alt
key is held down.
– Sam Hasler
Nov 20 at 9:40
@SamHasler I changed my answer, please revise it once more.
– Da Mahdi03
Nov 20 at 9:49
Sorry, that still doesn't answer the question. I wanted something that would show all possible shortcuts whenCtrl
was held down. I'm happy with KeyTips (see the image I've added to the answer).
– Sam Hasler
Nov 21 at 13:26
add a comment |
up vote
-1
down vote
You don't require any library for keyboard shortcuts. Simply use the keys in the Object passed in the keydown object. For instance:
var element = document.querySelector("#element");
element.addEventListener("keydown", function (event) {
//Ctrl+Alt+Del
if (event.key === "Delete" && event.ctrlKey === true && event.altKey === true) {
//Disables Ctrl+Alt+Del
event.preventDefault();
alert("You pressed Ctrl+Alt+Del, too bad!");
}
//Win+R (On Windows, it opens up the Run Prompt)
else if (event.key === "r" && event.metaKey === true) {
//Disable it once again
event.preventDefault();
alert("You can never 'run' from me!!");
}
//Create A Save Prompt When Users Ctrl+S
else if (event.key === "s" && event.ctrlKey === true) {
event.preventDefault();
//Give The User Options
alert("First choose an option to save, then continue.");
}
});
And then, from there, simply add the title
attribute to the element, to create a browser generated tooltip, and simply focus()
on the element when the shortcut is pressed.
JavaScript:
var element = document.querySelector("#element");
if (event.key === "h" && event.ctrlKey === true) {
event.preventDefault();
element.focus();
}
HTML:
<p title="help section" id="element">Help Help Help<p>
Hope that helps!
This down't answer the question. The question was how do you show a tooltip beside all elements that have a shortcut (via anaccesskey
attribute) when thectrl
/alt
key is held down.
– Sam Hasler
Nov 20 at 9:40
@SamHasler I changed my answer, please revise it once more.
– Da Mahdi03
Nov 20 at 9:49
Sorry, that still doesn't answer the question. I wanted something that would show all possible shortcuts whenCtrl
was held down. I'm happy with KeyTips (see the image I've added to the answer).
– Sam Hasler
Nov 21 at 13:26
add a comment |
up vote
-1
down vote
up vote
-1
down vote
You don't require any library for keyboard shortcuts. Simply use the keys in the Object passed in the keydown object. For instance:
var element = document.querySelector("#element");
element.addEventListener("keydown", function (event) {
//Ctrl+Alt+Del
if (event.key === "Delete" && event.ctrlKey === true && event.altKey === true) {
//Disables Ctrl+Alt+Del
event.preventDefault();
alert("You pressed Ctrl+Alt+Del, too bad!");
}
//Win+R (On Windows, it opens up the Run Prompt)
else if (event.key === "r" && event.metaKey === true) {
//Disable it once again
event.preventDefault();
alert("You can never 'run' from me!!");
}
//Create A Save Prompt When Users Ctrl+S
else if (event.key === "s" && event.ctrlKey === true) {
event.preventDefault();
//Give The User Options
alert("First choose an option to save, then continue.");
}
});
And then, from there, simply add the title
attribute to the element, to create a browser generated tooltip, and simply focus()
on the element when the shortcut is pressed.
JavaScript:
var element = document.querySelector("#element");
if (event.key === "h" && event.ctrlKey === true) {
event.preventDefault();
element.focus();
}
HTML:
<p title="help section" id="element">Help Help Help<p>
Hope that helps!
You don't require any library for keyboard shortcuts. Simply use the keys in the Object passed in the keydown object. For instance:
var element = document.querySelector("#element");
element.addEventListener("keydown", function (event) {
//Ctrl+Alt+Del
if (event.key === "Delete" && event.ctrlKey === true && event.altKey === true) {
//Disables Ctrl+Alt+Del
event.preventDefault();
alert("You pressed Ctrl+Alt+Del, too bad!");
}
//Win+R (On Windows, it opens up the Run Prompt)
else if (event.key === "r" && event.metaKey === true) {
//Disable it once again
event.preventDefault();
alert("You can never 'run' from me!!");
}
//Create A Save Prompt When Users Ctrl+S
else if (event.key === "s" && event.ctrlKey === true) {
event.preventDefault();
//Give The User Options
alert("First choose an option to save, then continue.");
}
});
And then, from there, simply add the title
attribute to the element, to create a browser generated tooltip, and simply focus()
on the element when the shortcut is pressed.
JavaScript:
var element = document.querySelector("#element");
if (event.key === "h" && event.ctrlKey === true) {
event.preventDefault();
element.focus();
}
HTML:
<p title="help section" id="element">Help Help Help<p>
Hope that helps!
edited Nov 20 at 9:48
answered Nov 19 at 3:48
Da Mahdi03
13117
13117
This down't answer the question. The question was how do you show a tooltip beside all elements that have a shortcut (via anaccesskey
attribute) when thectrl
/alt
key is held down.
– Sam Hasler
Nov 20 at 9:40
@SamHasler I changed my answer, please revise it once more.
– Da Mahdi03
Nov 20 at 9:49
Sorry, that still doesn't answer the question. I wanted something that would show all possible shortcuts whenCtrl
was held down. I'm happy with KeyTips (see the image I've added to the answer).
– Sam Hasler
Nov 21 at 13:26
add a comment |
This down't answer the question. The question was how do you show a tooltip beside all elements that have a shortcut (via anaccesskey
attribute) when thectrl
/alt
key is held down.
– Sam Hasler
Nov 20 at 9:40
@SamHasler I changed my answer, please revise it once more.
– Da Mahdi03
Nov 20 at 9:49
Sorry, that still doesn't answer the question. I wanted something that would show all possible shortcuts whenCtrl
was held down. I'm happy with KeyTips (see the image I've added to the answer).
– Sam Hasler
Nov 21 at 13:26
This down't answer the question. The question was how do you show a tooltip beside all elements that have a shortcut (via an
accesskey
attribute) when the ctrl
/alt
key is held down.– Sam Hasler
Nov 20 at 9:40
This down't answer the question. The question was how do you show a tooltip beside all elements that have a shortcut (via an
accesskey
attribute) when the ctrl
/alt
key is held down.– Sam Hasler
Nov 20 at 9:40
@SamHasler I changed my answer, please revise it once more.
– Da Mahdi03
Nov 20 at 9:49
@SamHasler I changed my answer, please revise it once more.
– Da Mahdi03
Nov 20 at 9:49
Sorry, that still doesn't answer the question. I wanted something that would show all possible shortcuts when
Ctrl
was held down. I'm happy with KeyTips (see the image I've added to the answer).– Sam Hasler
Nov 21 at 13:26
Sorry, that still doesn't answer the question. I wanted something that would show all possible shortcuts when
Ctrl
was held down. I'm happy with KeyTips (see the image I've added to the answer).– Sam Hasler
Nov 21 at 13:26
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f11473023%2fjavascript-library-to-show-tooltips-with-keyboard-shortcuts-when-holding-down-al%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
A browser extension perhaps? Rather than a "JavaScript library"...? Or is this something you wish to apply to your own website? When you refer to "associated keyboard shortcuts", are you referring to AccessKeys, or something more?
– MrWhite
Jul 10 '12 at 16:13
It's a web app, and it probably would have to work with AccessKeys
– Sam Hasler
Jul 10 '12 at 16:15
@w3d Thanks for the AccessKeys hint. I was able to find something that does what I'm after.
– Sam Hasler
Jul 10 '12 at 16:23
Are you wanting to do this for your site or do it within your browser? I know Opera does this automatically.
– Ryan B
Jul 13 '12 at 17:14
@RyanB this is a for a B2B web app.
– Sam Hasler
Jul 18 '12 at 9:20