Comments (7)
All I want right now is to be able to press any key on the device and console.log. This is not HID, just normal internal keyboard.
For that you would need to implement the pin scanning code, just like the rust sample you mentioned.
from devicescript.
Thanks done and done
https://www.npmjs.com/package/cardputer
https://github.com/reggi/cardputer
For future travelers if you want to use the cardputer keyboard with device script here's my code:
https://github.com/reggi/cardputer/blob/main/core/keyboard.ts#L83
from devicescript.
Let's see:
- you will need to add i2s support in a similar fashion to i2c to support the mic.
- you should be able to port the Rust driver to devicescript using the gpio module and detect the keystrokes.
can act as an external keyboard over USB (is this what a HID Keyboard is)
Yep.
Is it possible to do both via devicescript?
We do have hid keyboard driver in jacdac (https://github.com/microsoft/jacdac-c/blob/main/services/hidkeyboard.c) but i don't think it is fully wired up for devicescript. @mmoskal
Anyhow, it's gonna require work and somewhat getting deep in building devicescript itself.
from devicescript.
@pelikhan thanks for this, I'm digging into the source. I'd down to contribute to the project.
All I want right now is to be able to press any key on the device and console.log
. This is not HID, just normal internal keyboard.
I can't find this code: https://microsoft.github.io/devicescript/api/clients/keyboardclient
When I search the project for KeyboardClient
nothing shows up 🙃
Where do I start?
from devicescript.
@pelikhan I got this working so far for this device I got the following working:
- Onboard LED
- LCD 16bit colors
- Keyboard
I'd like to put all this in a module that people can reuse. I think I'm interested in making something more custom.
However modules like @devicescript/drivers
aren't in the npm (or github) registry.
How can I make my code into a package?
I tried using peerDependencies
and workspaces but no luck.
"peerDependencies": {
"@devicescript/core": "2.16.2",
"@devicescript/spi": "2.16.2",
"@devicescript/drivers": "2.16.2",
"@devicescript/graphics": "2.16.2",
"@devicescript/server": "2.16.2"
}
The only last idea i have is to do something more like AMD and pass every device script dependency in as a function argument 🙃
from devicescript.
Here is a sample of npm packages --> https://github.com/microsoft/devicescript/blob/main/packages/cowsay/package.json
You don't have to declare any of those @devicescript depedencies as they are "created" by the devicescript init
command.
from devicescript.
Note that we'll be happy to take your drivers contributions back into @devicescript/drivers as well!
from devicescript.
Related Issues (20)
- bme680 iaq is really gas HOT 1
- C driver device sometimes decides to not restart
- tool install fails because of missing name in package.json
- in codespace, connect url uses wrong port
- start dev server lazily
- only show icon in status bar when inactive
- M5Stack support HOT 3
- No DeviceScript Managers found HOT 28
- name of new project is "./"
- > The startAccelerometer returns a client that is already bound to your server so you don't need the "const a .... " line. You can simply remove it. HOT 3
- Error: spawn wmic ENOENT windows 11 HOT 1
- "error can't alloc pcb" occurs when calling fetch API. HOT 1
- TLS support on RP2040! HOT 1
- RGB Pins occupied by PSRAM HOT 2
- fetch is not defined HOT 4
- Device firmware is outdated, but no newer firmware is available HOT 3
- ESP32-S3 possibly incorrect flash pins (M5Stack Cardputer) HOT 11
- Unfinished javascript spec HOT 1
- Drawn image is shown with interlaced horizontal black lines? HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from devicescript.