tentone / syncinput

Synchronous keyboard and mouse input for web applications. Useful for games and canvas / webgl synchronous content in web applications.
https://tentone.github.io/syncinput/
MIT License
20 stars 4 forks source link

Any way to import into an ES6 project? #1

Closed manuq closed 1 year ago

manuq commented 1 year ago

This library looks great! Is there any way it can be imported into a project that doesn't use typescript? I tried (after npm install syncinput):

import { Keyboard, Mouse, Gamepad, Touch } from 'syncinput'

But I get the following in the browser console:

Uncaught SyntaxError: The requested module '/node_modules/.vite/deps/syncinput.js?v=0a367369' does not provide an export named 'default' (at app.js?t=1679330992577:3:8)
tentone commented 1 year ago

Hello

Thanks a lot for reporting this issue.

There was a problem with the way the build was exported from the package.

Update to version 1.3.8 should be fixed now.

Thanks a lot!

manuq commented 1 year ago

@tentone it works now, thank you so much! I see in this new version that the constants for keys are now in a separate module. I opened https://github.com/tentone/syncinput/pull/2 to update the README. Please let me know if that's not what you intended.