Giter VIP home page Giter VIP logo

scratch-extension-docs's People

Contributors

cwillisf avatar rschamp avatar sclements avatar tjvr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

scratch-extension-docs's Issues

ext._shutdown() not called when extension is removed

When someone removes an extension from a project, the ext._shutdown() function is not called.

Steps to reproduce:

  1. Add an extension
  2. Click the extension drop down under "More Blocks" and choose "Remove extension blocks"
  3. The ext._shutdown() function is not called

Add the ability to stop all scripts

When an exception occurs it would be nice to be able to stop all scripts from executing. We can notify the user via a js alert, but if they're using a loop the alert will keep coming back unless we have a way to stop all scripts.

Can not poll data from HID if there is no data returned.

In scratch_ext.js, extension will disconnect if there is no data read. However, The extension has no ideas when data comes from HID. So we need to keep polling even there is no data. Scratch shouldn't disconnect just because there is nothing to read.

    this.read = function(len) {
        if(!dev) return null;
        if(!len) len = 65;
        var data = dev.read(len);
        if(window.ActiveXObject) data = data(len);
        if(data.byteLength == 0) disconnect();
        return data;
    };

Feature Request

Would it be possible when specifying the block text in the .js file to also specify a block color?

I am writing an extension that will have similar functionality for several hardware devices and would like to classify/separate the device types by color.

Also, it would be nice to be able to draw a separator line between any given blocks so that "classes" of extension blocks would be more apparent.

Give developer access to source code of scratch for debugging

Hi.
I'm experiencing problems in HID extension. Sometimes the extension keeps reconnecting device. And if I upload an extension. The scratch won't work if I restart my computer. Unless I remove extension from server and re-add the extension.

Now I see source JS code handling HID is compressed. So I can not add breakpoints or modify code to locate the source of problem. If I can open uncompressed code in chrome it will help a lot in debugging.

Thanks

HID device does not support choosing Interface

Hi.

I have a HID hardware with has 3 interfaces (or there will be trouble on Mac). The first interface in a keyboard, the second one is a gamepad and the third is a raw data one

usb_interface

I have a protocol to communicate with the third port. However when I open a device in scratch, the id is the first interface's. I don't have an option to choose the other interfaces.

However I can change my firmware to make the desired interface the first one and I made it work. I wish there is a parameter for interface.

if (e.hid) {
var s = n.hid_list(),
a = e.hid;
for (var f = 0; f < s.length; f++) {
var t = a[s[f].vendor_id + "_" + s[f].product_id];
t && r[t]._deviceConnected(new m(s[f].path, t))
}
}

Here is info from HIDAPI java library:

HIDDeviceInfo [path=?\hid#vid_94d8&pid_0055&mi_00#9&39c54981&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}, vendor_id=38104, product_id=85, serial_number=?, release_number=1, manufacturer_string=Microchip Technology Inc., product_string=Analog Keyboard, usage_page=65280, usage=1, interface_number=0]
HIDDeviceInfo [path=?\hid#vid_94d8&pid_0055&mi_01#9&2201bd3c&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}, vendor_id=38104, product_id=85, serial_number=?, release_number=1, manufacturer_string=Microchip Technology Inc., product_string=Analog Keyboard, usage_page=1, usage=6, interface_number=1]
HIDDeviceInfo [path=?\hid#vid_94d8&pid_0055&mi_02#9&756a6ed&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}, vendor_id=38104, product_id=85, serial_number=?, release_number=1, manufacturer_string=Microchip Technology Inc., product_string=Analog Keyboard, usage_page=1, usage=5, interface_number=2]

Include a block divider

The ability to add a divider with an optional title would be helpful in keeping extension blocks organized.

Extension blocks no longer loaded when an .sb2 file is uploaded

If I go to the More Blocks/Add an Extension/My Extensions and I load my extension, the blocks are shown correctly.

However, if I save the blocks to an .sb2 project, when I load that project, the blocks do not load.

This is new behavior.

Have JavaScript extensions been disabled when loading from a .sb2 file?

Incorrect Terminology in http://llk.github.io/scratch-extension-docs/

I believe the "Blocks" section of the extension doc has the definitions of asynchronous and synchronous reversed. Asynchronous means send the message and don't wait, while synchronous means send the message and "wait" (for reply, action, callback, etc.). I think the hat block is synchronous and that designation is correct.

image

What can it do?

Will it also be able to add new menu items to the Editor's menus?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.