This turns out to be very doable, and my initial problems were probably more related to the general novelty of Android (this is my first Android application), and not to KeyboardView. In particular, I'm used to the fact that visibility is a simple binary property.
Anyway:
- Declare
KeyboardViewin your xml file with android:visibility="gone". - Before making the view visible, call
setKeyboard()to attach the keyboard. This is important because it KeyboardViewgets its size from the keyboard. - To get raw key events, call
KeyboardView.setOnKeyboardActionListener(). After reorganizing this function from Dialogback to my core View, I put the functionality OnKeyboardActionListenerin a standalone class, but this is not necessary. keyboardView.setEnabled(true);. , (), ; , setEnabled(false).keyboardView.setPreviewEnabled(true); - , biox .- , ,
keyboardView.setVisibility(VISIBLE);.
, , keyboardView.setVisibility(GONE);. ( " ", setKeyboard . Map<<Integer, Keyboard> ; , , .