Examples of NspireVirtualKeyStroke


Examples of com.ti.et.education.commproxy.NspireVirtualKeyStroke

        }
    }

    public static void sendEvent(String keyStr, INodeID nodeID) throws Exception {
        NodeHandle hdl = nncp.getHandle(nodeID);
        sendEventToNode(hdl, new NspireVirtualKeyStroke(keyStr));
    }
View Full Code Here

Examples of com.ti.et.education.commproxy.NspireVirtualKeyStroke

            System.out.println("No calc(s) to send events to.");
            return;
        }
        for (INodeID nodeID : theCalcs) {
            hdl = nncp.getHandle(nodeID);
            sendEventToNode(hdl, new NspireVirtualKeyStroke(keyStr));
            // sleep needed ? I don't have enough calcs to test a classroom setup....
        }
    }
View Full Code Here

Examples of com.ti.et.education.commproxy.NspireVirtualKeyStroke

    public static int sendEventToNode(NodeHandle calcHandle, IEvent event)
            throws Exception {
        int status = 0;
        if (calcHandle != null) {
            NspireVirtualKeyStroke key = (NspireVirtualKeyStroke) event;
            byte[] keyBytesCode = key.getKeyCode();

            if (keyBytesCode != null) {
                ConnectionHandle ch = new ConnectionHandle();
                status = NavNet.connect(calcHandle, 16450, ch);

                if (status == 1) {
                    status = NavNet.write(ch, NspireVirtualKeyStroke.VIRTUAL_KEY_STROKE_EVENT_COMMAND, NspireVirtualKeyStroke.VIRTUAL_KEY_STROKE_EVENT_COMMAND.length);

                    if (status == 1) {
                        byte[] keyEvent = {0, 0, 0, 0, (byte) (key.getEventType() & 0xFF), 2, (byte) (keyBytesCode[0] & 0xFF), 0, (byte) (keyBytesCode[1] & 0xFF), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, (byte) (keyBytesCode[2] & 0xFF), 0};
                        status = NavNet.write(ch, keyEvent, keyEvent.length);
                        Thread.sleep(80L);
                    }
                    NavNet.disconnect(ch);
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.