Skip to content

Instantly share code, notes, and snippets.

View werpu's full-sized avatar
🏠
Working from home

Werner Punz werpu

🏠
Working from home
  • Irian GmbH
  • Linz, Austria
View GitHub Profile
# This is only one example of a gamepad descriptor, and may not suit your needs.
GAMEPAD_REPORT_DESCRIPTOR = bytes((
0x05, 0x01, # Usage Page (Generic Desktop Ctrls)
0x09, 0x05, # Usage (Game Pad)
0xA1, 0x01, # Collection (Application)
0x85, 0x04, # Report ID (4)
0x05, 0x09, # Usage Page (Button)
0x19, 0x01, # Usage Minimum (Button 1)
0x29, 0x20, # Usage Maximum (Button 32)
0x15, 0x00, # Logical Minimum (0)
import asyncio
stop_var = False
async def task2():
while not stop_var:
print("task2")
await asyncio.sleep(1)
<script>
import {onMount} from 'svelte'
import {layerStore} from "./componentStores.js"
export let id;
export let l1_code;
export let l1_value;
export let l2_code;
export let l2_value;
import {saveResolve} from "../shared/utils.js";
class ShiftKey extends HTMLElement {
static EVT_LAYERCHANGE = "layerchange";
observedAttrs = ["l1-code",
"l1-value",
"l2-code",
"l2-value",
class ShiftKey extends HTMLElement {
observedAttrs = ["l1_code",
"l1_d_value",
"l2_code",
"l2_d_value",
"l3_code",
"l3_d_value",
"l4_code",
"l4_d_value",
TagBuilder.withTagName("x-navigation")
.withMarkup("<button id='nav_c64' data-target='c64'>C64</button><button id='atari5200' data-target='atari5200'>Atari 5200</button><button id='coleco-1p' data-target='coleco-1p'>Colecovision</button>")
.withConnectedCallback(function () {
DomQuery.querySelectorAll("x-navigation button").addEventListener("click", (evt) => {
let target = evt.target.dataset["target"];
location.href = target + '.html';
}).each((item => {
item.removeClass("hidden");
if (item.attr("data-target").value == DomQuery.byId(this).attr("selected").value) {
item.addClass("hidden");
TagBuilder.withTagName("x-navigation")
.withMarkup("<button id='nav_c64' data-target='c64'>C64</button><button id='atari5200' data-target='atari5200'>Atari 5200</button><button id='coleco-1p' data-target='coleco-1p'>Colecovision</button>")
.withConnectedCallback(function () {
DomQuery.querySelectorAll("x-navigation button").addEventListener("click", (evt) => {
let target = evt.target.dataset["target"];
location.href = target + '.html';
}).each((item => {
item.removeClass("hidden");
if (item.attr("data-target").value == DomQuery.byId(this).attr("selected").value) {
item.addClass("hidden");
/* MIT License
#
# Copyright (c) 2019 Werner Punz
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
/* MIT License
#
# Copyright (c) 2019 Werner Punz
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
(function(e, a) { for(var i in a) e[i] = a[i]; }(window, /******/ (function(modules) { // webpackBootstrap
/******/ // The module cache
/******/ var installedModules = {};
/******/
/******/ // The require function
/******/ function __webpack_require__(moduleId) {
/******/
/******/ // Check if module is in cache
/******/ if(installedModules[moduleId]) {
/******/ return installedModules[moduleId].exports;