0

I have created custom keyboard in which I set below property. I want to change key image while it pressed, as we do with button in same way. how can I change key icon while it pressed?

 <Row>
        <Key
            android:id="@+id/key1"
            android:codes="8"
            android:keyEdgeFlags="left"
            android:keyIcon="@drawable/k1" />
        <Key
            android:codes="9"
            android:iconPreview="@drawable/k2hover"
             android:keyIcon="@drawable/k2" />
        <Key
            android:codes="10"
            android:iconPreview="@drawable/k3hover"
            android:keyEdgeFlags="right"
             android:keyIcon="@drawable/k3" />
    </Row>
Brinda K
  • 745
  • 3
  • 16
  • 34
user861973
  • 787
  • 3
  • 11
  • 26

1 Answers1

0

Try a :

row.setOnKeyPressed(new OnKeyPressed() {
    //Add the unimplemented methods
});
lokoko
  • 5,785
  • 5
  • 35
  • 68
  • how to create row object and in which file I can get row object?1. class BasicOnKeyboardActionListener implements OnKeyboardActionListener 2.class CustomKeyboardView extends KeyboardView – user861973 Dec 18 '12 at 10:12
  • Called when a hardware key is dispatched to a view. It doesn't work for soft keyboards. – m-szalik Dec 07 '18 at 17:05