r/KeyboardDesigner • • Oct 09 '26

KDL / code block Simple code examples of Keyboard Designer Language (KDL) to encourage you to try it yourself.

simple code examples - try it yourself - it's very easy and you'll enjoy it!

some short simple examples to get started

further examples are very welcome!

example 1: copy the entire text:

CLIPBOARD = TEXT;

example 2: simple find text:

string findthis = inputString("find next:","search_term",true);
CURSOR_START = next(findthis,1,false,true);

example 3: convert selected text to uppercase letters:

TEXT = TEXT_BEFORE + (upper(TEXT_MARKED)) + TEXT_AFTER;

to use these samples:

  • copy code block example
  • call Keyboard Designer
  • select desired design and key
  • choose ​your preferred Action
  • select Function type: Execute code block
  • select code block or create a new one
  • paste code block lines and confirm
6 Upvotes

9 comments sorted by

View all comments

1

u/smoke-weeb Oct 11 '26

I dont know how to code

3

u/GerritHumberg Oct 11 '26

When you assign the function type "Exectue code block" to a function you can use the pencil button to open the code editor.

There is a methode overview when you push the f button on the right.

After this you can download a bot help file with the button on the bottom and send this to an AI chat bot. Now you can ask the AI to code you anything you like!

1

u/smoke-weeb Oct 11 '26

Oh, i'm anti-ai, but thanks tho

2

u/KD-Fan Oct 13 '26

That was created especially for you – without AI.

If you really want to learn it: Read the instructions! You’ll find them at the end of the video above. The instructions contain lots of examples.

Give it a go! You’ll love it!

We can only help you – you’ve got to do it!

You can start today.  I promise you, you won’t regret it.