Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use in CDN mode ? #150

Open
paladio opened this issue Feb 16, 2022 · 4 comments
Open

How to use in CDN mode ? #150

paladio opened this issue Feb 16, 2022 · 4 comments

Comments

@paladio
Copy link

paladio commented Feb 16, 2022

Hi Dear Friends, How to use in CDN mode?

<script src="https://unpkg.com/[email protected]/dist/tinykeys.umd.js"></script>

I have attached the file to the html document but I do not know what script to use, what to change this script?

tinykeys(window, {
"Shift+D": () => {
alert("The 'Shift' and 'd' keys were pressed at the same time")
},
"y e e t": () => {
alert("The keys 'y', 'e', 'e', and 't' were pressed in order")
},
"$mod+KeyD": event => {
event.preventDefault()
alert("Either 'Control+d' or 'Meta+d' were pressed")
},
})

Please provide a complete description and example of how to use in CDN mode.

@jamiebuilds
Copy link
Owner

I think for some reason the compilation is screwed up and its putting everything on:

window.tinykeys.default(window, {
  "Shift+D": () => {
    alert("The 'Shift' and 'd' keys were pressed at the same time")
  },
  "y e e t": () => {
    alert("The keys 'y', 'e', 'e', and 't' were pressed in order")
  },
  "$mod+KeyD": event => {
    event.preventDefault()
    alert("Either 'Control+d' or 'Meta+d' were pressed")
  },
})

@ibnishak
Copy link

Any progress on this issue?

@san425
Copy link

san425 commented Nov 6, 2023

+1 Not exactly sure what to do?

@yg-i
Copy link

yg-i commented Nov 6, 2023

@san425 try this

tinykeys.tinykeys(window, {
	"Control+Shift+KeyK": event => console.log("ctrl+shift+k"),
	"Control+Shift+KeyM": event => console.log("ctrl+shift+m"),
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants