Code example for KeyboardView.OnKeyboardActionListener

Methods: onKey, onText

1
			changeState(cd.mod, cd.isLock);		// process a 'mod' or 'lock'
		} 
		else if (actionListener != null) {
			resetState(); 
			if (cd.code != null)
				actionListener.onText(cd.code); // process a 'code'
			else if (cd.keyCode >= 0)
				actionListener.onKey(cd.keyCode, null); // process a 'key'
			else if (actionListener instanceof CompassKeyboard) {
				CompassKeyboard ck = (CompassKeyboard)actionListener;
				if (cd.layout >= 0)
					ck.updateLayout(cd.layout); // process a 'layout'
				else if ((cd.cmd != null) && (cd.cmd.length() > 0))
					ck.execCmd(cd.cmd); // process a 'cmd'
			} 
			vibrateCode(vibrateOnKey);
		} 
 
		return true; 
	}