Jump to content
Chalkim

matrix keyboard Driver

Recommended Posts

Hi,

I'm trying to add a TEXTEDIT on my lcd. But it needs a keyboard to do the input work. What I have is a 4*4 matrix keyboard ( number and some keys for custom). Obviously, there‘s no exist driver in the demo. So, I wonder how can I add my own driver. Is there any file like board_xxx.h? Or something else?

Thank you for any help!

Share this post


Link to post
Share on other sites

There are a couple of example keyboard drivers you can copy and modify. Just copy an existing driver, modify it and link link it into your project instead on one of the standard drivers.

While this is a bit laborious in V2.x it will be much easier in V3.

Share this post


Link to post
Share on other sites
7 hours ago, inmarket said:

There are a couple of example keyboard drivers you can copy and modify. Just copy an existing driver, modify it and link link it into your project instead on one of the standard drivers.

While this is a bit laborious in V2.x it will be much easier in V3.

Thanks, but I can only find dial/toggle/tough at /uGFX/drivers. The toggle driver can do some simple job like a switch. However, I need a keyboard to type words. The problem is that how can I map the keys to different key-values, so that I can link the driver to uGFX. I try to find a example but I didn't find it, maybe I get the wrong directory. Anyway, could you please tell me where I can find it or provide a demo code?

Thank you.

Share this post


Link to post
Share on other sites

Have a look at the gkeyboard drivers. They support having multiple character sets mapped to the same key depending on their mode. Take a normal pc keyboard, it produces scan codes (equivalent to your 4x4 keyboard producing codes 0 to 16) which get translated to ascii characters which depend on the language, the mapping mode eg numlock/capslock, and multi-key combinations like shift. So your 4x4 keyboard is a large simplification on a keyboard such as a pc keyboard for which you already have the driver in the ugfx repository for you to use as example code.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...