Whether the keyboard is displayed.
198373
def isKeyboardShown(self):
        '''
        
        '''

        self.__checkTransport()
        dim = self.shell('dumpsys input_method')
        if dim:
            # FIXME: API >= 15 ?
            return "mInputShown=true" in dim
        return False
824774
function Keyboard(keyMap) {
	/**
	 * The current key states.
	 * @member {object}
	 * @private
	 */
	this.keys = {};

	var self = this;
	for (var kc in keyMap) {
		if (keyMap.hasOwnProperty(kc)) {
			this.keys[keyMap[kc]] = 0;
		}
	}
	window.addEventListener("keydown", function(event) {
		if (keyMap.hasOwnProperty(event.keyCode)) {
			if (self.keys[keyMap[event.keyCode]] === 0) {
				self.keys[keyMap[event.keyCode]] = 2;
			}
			return false;
		}
	});
	window.addEventListener("keyup", function(event) {
		if (keyMap.hasOwnProperty(event.keyCode)) {
			self.keys[keyMap[event.keyCode]] = 0;
			return false;
		}
	});
}
675834
function () {
            // toggleDropdown should not make the virtual keyboard appear on touch devices
            this._updateFocusNoKeyboard();
            if (!this._hasFocus) {
                this.focus(null, true);
            }

            var report = this.controller.toggleDropdown(this.getTextInputField().value, this._dropdownPopup != null);
            this._reactToControllerReport(report, {
                hasFocus : true
            });

            this.focus(null, true);
        }
1251561
public static boolean isKeyboardVisible(Activity activity) {
        Rect r = new Rect();

        View activityRoot = getActivityRoot(activity);

        activityRoot.getWindowVisibleDisplayFrame(r);

        int screenHeight = activityRoot.getRootView().getHeight();
        int heightDiff = screenHeight - r.height();

        return heightDiff > screenHeight * KEYBOARD_MIN_HEIGHT_RATIO;
    }
123702
def get_keyboard_mapping(self, first_keycode, count):
        """"""
        r = request.GetKeyboardMapping(display = self.display,
                                       first_keycode = first_keycode,
                                       count = count)
        return r.keysyms
1167880
function(e) {
            this._tabReset();
            if (e.which == 9) {
                this.flags.keyTab = true;
                if (e.shiftKey) { this.flags.keyShift = true; }
            }
        }
1329222
function(kb) {
			if (!kb.keys) { return false; }
			if (kb.keys.length !== this.keys.length) { return false; }
			for (var i=0; i<kb.keys.length; i++) {
				if (!kb.keys[i].equals(this.keys[i])) { return false; }
			}
			return true;
		}
147468
def on_key_up(self):
        
        if (self.last_pressed is not None):
            self.set_key_state(self.last_pressed, 0)
            self.buffer = self.last_pressed.update_buffer(self.buffer)
            self.text_consumer(self.buffer)
            self.last_pressed = None
251211
def enabled(self):
        
        # In auto-detection mode color enabled when terminal attached
        if self._mode == COLOR_AUTO:
            return sys.stdout.isatty()
        return self._mode == COLOR_ON
371784
def wait_for_keyboard(timeout: nil)
      keyboard_timeout = keyboard_wait_timeout(timeout)
      message = "Timed out after #{keyboard_timeout} seconds waiting for the keyboard to appear"
      wait_for(message, timeout: keyboard_timeout) do
        keyboard_visible?
      end
    end
933479
def get_keyboard_mapping_unchecked(conn):
    
    mn, mx = get_min_max_keycode()

    return conn.core.GetKeyboardMappingUnchecked(mn, mx - mn + 1)
126236
def is_screen_on(self):
        '''
        
        '''

        _screenOnRE = re.compile('mScreenOnFully=(true|false)')
        m = _screenOnRE.search(self.shell('dumpsys', 'window', 'policy'))
        if m:
            return (m.group(1) == 'true')
        raise RuntimeError("Couldn't determine screen ON state")
1249937
def _keyUp(key):
    

    """
    Release a given character key. Also works with character keycodes as
    integers, but not keysyms.
    """
    if key not in keyboardMapping or keyboardMapping[key] is None:
        return

    if type(key) == int:
        keycode = key
    else:
        keycode = keyboardMapping[key]

    fake_input(_display, X.KeyRelease, keycode)
    _display.sync()
4609
def confirm(prompt):
    
    while True:
        try:
            answer = input(prompt)
        except KeyboardInterrupt:
            # the user presses ctrl+c, just say 'no'
            return False
        answer = answer.strip().lower()
        if answer not in ('y', 'n'):
            print('Please enter y or n')
            continue
        return answer == 'y'
1103311
public void okToUseGui() {
        if (_mayUseGui) return;

        _mayUseGui = true;

        for (Object o : _children.keySet()) {
            if (o instanceof Visibility) {
                ((Visibility) o).okToUseGui();
            }
        }
    }
874864
def char_on(self, c):
        
        if c.upper() in CHARACTERS:
            for i in CHARACTERS[c.upper()]:
                self.light_on(BUTTONS[i])
642515
def is_pressed(self, button):
        """"""
        if button not in set((SELECT, RIGHT, DOWN, UP, LEFT)):
            raise ValueError('Unknown button, must be SELECT, RIGHT, DOWN, UP, or LEFT.')
        return self._mcp.get(button)