mirror of
https://github.com/neosubhamoy/neosubhamoy-portfolio.git
synced 2025-12-20 06:59:34 +05:30
(refactor): improved keyboard shotcut keyevent detection
This commit is contained in:
@@ -123,7 +123,7 @@ mobileSearchBtn.addEventListener("click", function () {
|
||||
|
||||
// when ALT + K shortcut key is pressed
|
||||
document.addEventListener("keydown", function(event) {
|
||||
if (event.altKey && event.key === "k") {
|
||||
if ((event.altKey && event.key === "k") || (event.altKey && event.key === "K")) {
|
||||
if(!isShareActive) {
|
||||
activate_search();
|
||||
}
|
||||
@@ -442,7 +442,7 @@ mobileShareCloseBtn.addEventListener("click", function () {
|
||||
|
||||
// when ALT + L shortcut key is pressed
|
||||
document.addEventListener("keydown", function(event) {
|
||||
if (event.altKey && event.key === "l") {
|
||||
if ((event.altKey && event.key === "l") || (event.altKey && event.key === "L")) {
|
||||
if(!isSearchActive) {
|
||||
activate_share();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user