Review Request 119254: Add support for receiving keyboard entries

Saikrishna Arcot saiarcot895 at gmail.com
Wed Jul 16 15:10:22 UTC 2014



> On July 13, 2014, 10:47 p.m., Aleix Pol Gonzalez wrote:
> > If we send characters we won't be able to remove characters then?
> > 
> > Why don't you try it?
> 
> Saikrishna Arcot wrote:
>     In theory, removing characters would also be possible, since the backspace character has a unicode number. In practice, however, this isn't working. Android is either not able to convert the backspace character into a unicode number. I'll have to see if there is a workaround for that.
>     
>     On another note, I found two bugs. One is that there is one other line I need to change on the KDE side to allow it to act on the keyboard. The other bug is that the X keycodes don't match up with unicode characters. What's more is that the keycode for lowercase `a` and uppercase `A` is the same. This complicates things a bit.
> 
> Saikrishna Arcot wrote:
>     (I thought I had published the above comment several days ago, but I guess I forgot to click the button.)
>     
>     I published a change to account for the uppercase and lowercase versions. I'll work on getting Backspace and Enter keys working.
> 
> Aleix Pol Gonzalez wrote:
>     Well, it's a different thing a character and a key identifier.
>     
>     In my keyboard I only have 1 "a" key. ;)
> 
> Albert Vaca Cintora wrote:
>     There is a keyboard for Android called the Hacker's keyboard that allows you to even send PgUp, PgDown, Home, End, Ctrl, Alt, Fn, etc. keystrokes to the apps. Do you think it would be possible to capture these keystrokes and send the directly to KDE? (ie: not the actual letter but the keystroke itself). That would be better than this approach but I'm not sure if it's possible (because some symbols in the android are not keys individual keys in a regular keyboard). 
>     
>     If this is not possible (and we stick with sending just letters), it would be nice to allow to send special keys (Ctrl, Alt, etc.) anyway if we have a keyboard on Android that supports it. The same code that will allow you to send those keys will probably allow you to send backspaces and other non-letter keys as well.
> 
> Aleix Pol Gonzalez wrote:
>     We can always add visual keys for that, no?

Visual keys could probably be added for those special keys, but a standardized method of transmission has to happen. On the Android side, there's a whole list of `KEYCODE_*` constants that describe what key it is and a few constants to get some of the special keys (see [KeyEvent](https://developer.android.com/reference/android/view/KeyEvent.html)). There's also a method to convert the key entered into Unicode. Since that is mostly standard (except in X, it seems; they decided to go by the local keyboard keymapping), I chose to transmit the character entered in this format. For the Ctrl, Alt, and Fn (maybe?) keys, there will have to be a separate modifier field transmitted that describes (with bit manipulation) which keys are pressed. For the PgUp and PgDown, we'll just have to look up the unicode, transmit it, and convert it to whatever X wants.

The other thing to note is that some (physical) keyboards might rely on these special keys to give different characters. I don't know how Android displays/handles these keys (I don't use such layouts) or how much changes will need to be done on the KDE side.


- Saikrishna


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/119254/#review62261
-----------------------------------------------------------


On July 16, 2014, 1:30 p.m., Saikrishna Arcot wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/119254/
> -----------------------------------------------------------
> 
> (Updated July 16, 2014, 1:30 p.m.)
> 
> 
> Review request for kdeconnect.
> 
> 
> Repository: kdeconnect-kde
> 
> 
> Description
> -------
> 
> Add support for receiving keyboard entries.
> 
> This patch gets the keyboard entries from the Android client and passes along the keycode.
> 
> The Android version is [here](https://git.reviewboard.kde.org/r/119255/).
> 
> 
> Diffs
> -----
> 
>   plugins/mousepad/mousepadplugin.cpp 64aae5cc938e2630bde3f329ec01bcd9b8651ce5 
> 
> Diff: https://git.reviewboard.kde.org/r/119254/diff/
> 
> 
> Testing
> -------
> 
> Checked and tested. Backspace and enter keys don't work (yet), and special symbols aren't entered in. 
> 
> 
> Thanks,
> 
> Saikrishna Arcot
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdeconnect/attachments/20140716/fc957e9e/attachment-0001.html>


More information about the KDEConnect mailing list