Package org.jnode.driver.input

Examples of org.jnode.driver.input.KeyboardLayoutManager


    }

    @Override
    public void doComplete(CompletionInfo completions, String partial, int flags) {
        try {
            KeyboardLayoutManager mgr = InitialNaming.lookup(KeyboardLayoutManager.NAME);
            // collect matching devices
            for (String layout : mgr.layouts()) {
                if (layout.startsWith(partial)) {
                    completions.addCompletion(layout);
                }
            }
        } catch (NameNotFoundException ex) {
View Full Code Here


     * Execute this command
     */
    public void execute() throws Exception {
        PrintWriter out = getOutput().getPrintWriter();
        PrintWriter err = getError().getPrintWriter();
        final KeyboardLayoutManager mgr = InitialNaming.lookup(KeyboardLayoutManager.NAME);
        final Collection<Device> kbDevs =
            DeviceUtils.getDevicesByAPI(KeyboardAPI.class);

        if (argAdd.isSet()) {
            String layoutID = getLayoutID(mgr);
            if (!argClass.isSet()) {
                throw new CommandSyntaxException(ex_syntax_class);
            }
            String className = argClass.getValue();
            mgr.add(layoutID, className);
            out.format(fmt_add, layoutID);
        } else if (argRemove.isSet()) {
            String layoutID = getLayoutID(mgr);
            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
View Full Code Here

            intPipe.open();
            final USBRequest req = intPipe.createRequest(intData);
            intPipe.asyncSubmit(req);

            // Configure the default keyboard layout and register the KeyboardAPI
            KeyboardLayoutManager mgr = InitialNaming.lookup(KeyboardLayoutManager.NAME);
            apiAdapter.setKbInterpreter(mgr.createDefaultKeyboardInterpreter());
            dev.registerAPI(KeyboardAPI.class, apiAdapter);

            // Start the key event thread
            keyEventThread =
                    new ByteQueueProcessorThread(dev.getId() + "-daemon", keyCodeQueue, this);
View Full Code Here

TOP

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

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.