Package org.jnode.driver.input

Examples of org.jnode.driver.input.KeyboardAPI


        }

        public void deviceStarted(Device device) {
            if (device.implementsAPI(KeyboardAPI.class)) {
                try {
                    KeyboardAPI api = device.getAPI(KeyboardAPI.class);
                    keyboardList.add(api);
                    for (KeyboardListener listener : listenerList) {
                        api.addKeyboardListener(listener);
                    }
                } catch (ApiNotFoundException anfe) {
                    //ignore
                }
            }
View Full Code Here


        }

        public void deviceStop(Device device) {
            if (device.implementsAPI(KeyboardAPI.class)) {
                try {
                    KeyboardAPI api = device.getAPI(KeyboardAPI.class);
                    keyboardList.remove(api);
                    for (KeyboardListener listener : listenerList) {
                        api.removeKeyboardListener(listener);
                    }
                } catch (ApiNotFoundException anfe) {
                    //ignore
                }
            }
View Full Code Here

     * @param keycode
     * @param pressed true=key pressed, false=key released
     */
    private void sendKeyboardEvent(int keycode, boolean pressed) {
        final KeyboardHandler kbHandler = getToolkitImpl().getKeyboardHandler();
        final KeyboardAPI api = kbHandler.getKeyboardAPI();
        final KeyboardInterpreter kbInt = api.getKbInterpreter();
        final KeyboardEvent event = kbInt.interpretKeycode(keycode);
        if (event != null) {
            if (pressed)
                kbHandler.keyPressed(event);
            else
View Full Code Here

            mgr.remove(layoutID);
            out.format(fmt_remove, layoutID);
        } else if (argSet.isSet()) {
            String layoutID = getLayoutID(mgr);
            for (Device kb : kbDevs) {
                final KeyboardAPI api = kb.getAPI(KeyboardAPI.class);
                try {
                    final KeyboardInterpreter kbInt = mgr.createKeyboardInterpreter(layoutID);
                    out.format(fmt_set_interp, kb.getId(), kbInt.getClass().getName());
                    api.setKbInterpreter(kbInt);
                } catch (KeyboardInterpreterException ex) {
                    err.format(ex_set_interp, kb.getId(), ex.getLocalizedMessage());
                    // Re-throw the exception so that the shell can decide whether or not
                    // to print a stacktrace.
                    throw ex;
                }
            }
        } else {
            for (Device kb : kbDevs) {
                final KeyboardAPI api = kb.getAPI(KeyboardAPI.class);
                out.format(fmt_list_interp, kb.getId(), api.getKbInterpreter().getClass().getName());
            }
        }
    }
View Full Code Here

                // Ignore
            }
        }
        if (device.implementsAPI(KeyboardAPI.class)) {
            try {
                final KeyboardAPI api = device.getAPI(KeyboardAPI.class);
                api.addKeyboardListener(debugger);
            } catch (ApiNotFoundException ex) {
                // Ignore
            }
        }
    }
View Full Code Here

                // Ignore
            }
        }
        if (device.implementsAPI(KeyboardAPI.class)) {
            try {
                final KeyboardAPI api = device.getAPI(KeyboardAPI.class);
                api.removeKeyboardListener(debugger);
            } catch (ApiNotFoundException ex) {
                // Ignore
            }
        }
    }
View Full Code Here

            public Object run() {
                try {
                    final Collection<Device> devs = DeviceUtils
                        .getDevicesByAPI(KeyboardAPI.class);
                    for (Device dev : devs) {
                        final KeyboardAPI api = dev.getAPI(KeyboardAPI.class);
                        api.setPreferredListener(l);
                    }
                } catch (ApiNotFoundException ex) {
                    // Ignore
                }
                return null;
View Full Code Here

TOP

Related Classes of org.jnode.driver.input.KeyboardAPI

Copyright © 2018 www.massapicom. 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.