Skip to content

Commit

Permalink
add hid sample
Browse files Browse the repository at this point in the history
  • Loading branch information
mmoskal committed Mar 21, 2023
1 parent 807735a commit 2ace987
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions vscode/sampleprj/packages/sampleprj/src/kbd.ts
@@ -0,0 +1,16 @@
import { startHidKeyboard } from "@devicescript/servers"
import * as ds from "@devicescript/core"

const kbd = startHidKeyboard({})
const btn = new ds.Button()
btn.down.subscribe(async () => {
await kbd.key(
ds.HidKeyboardSelector.C,
ds.HidKeyboardModifiers.None,
ds.HidKeyboardAction.Press
)
})

setInterval(() => {
// console.log("alive", btn.isBound)
}, 1000)

0 comments on commit 2ace987

Please sign in to comment.