Jump to content

Recommended Posts

Posted

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!

Posted

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.

Posted
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.

Posted

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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...