# Keyboard Handler In Clarion

**URL:** <https://clarionhub.com/t/keyboard-handler-in-clarion/7833>\
**Category:** questions\
**Tags:** winapi\
**Created:** [January 13, 2025, 4:58pm UTC](https://clarionhub.com/t/keyboard-handler-in-clarion/7833 "2025-01-13T16:58:08Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jim-Morgan](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@Jim-Morgan](https://clarionhub.com/u/Jim-Morgan)\
**Post date:** [January 13, 2025, 4:58pm UTC](https://clarionhub.com/t/keyboard-handler-in-clarion/7833/1 "2025-01-13T16:58:09Z")

</div>

I have a client with a color reader that stuffs values into the keyboard buffer. (NOT the clipboard). It simulates manual keyboard entry. The input is number tab number tab number tab. The numbers come in as expected in a browser app, Excel and notepad, but not the Clarion application. If you position the cursor in a number field or notes field in Clarion, it does not matter. Clarion does not see the input. How is that possible? Is there a work around?

---

<div class="post-metadata">

**Author:** ![ncik](https://clarionhub.com/user_avatar/clarionhub.com/ncik/32/1468_2.png) [@ncik](https://clarionhub.com/u/ncik)\
**Post date:** [January 13, 2025, 6:04pm UTC](https://clarionhub.com/t/keyboard-handler-in-clarion/7833/2 "2025-01-13T18:04:57Z")

</div>

Do not know but I would try to log clarion events and see if anything happens inside clarion window.

---

<div class="post-metadata">

**Author:** ![jslarve](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@jslarve](https://clarionhub.com/u/jslarve)\
**Post date:** [January 13, 2025, 6:08pm UTC](https://clarionhub.com/t/keyboard-handler-in-clarion/7833/3 "2025-01-13T18:08:12Z")

</div>

Have you tried testing for all events? Such as EVENT:Rejected? Might not be applicable since you’re also trying on what I assume could be a text control.

Do any messages appear in a subclass procedure?

Does focus remain on the previously selected control?

---

<div class="post-metadata">

**Author:** ![MarkGoldberg](https://clarionhub.com/user_avatar/clarionhub.com/markgoldberg/32/1511_2.png) [@MarkGoldberg](https://clarionhub.com/u/MarkGoldberg)\
**Post date:** [January 13, 2025, 8:03pm UTC](https://clarionhub.com/t/keyboard-handler-in-clarion/7833/4 "2025-01-13T20:03:54Z")

</div>

Is it possible that your clarion application is elevated, and the keyboard stuffer is not elevated?

---

<div class="post-metadata">

**Author:** ![jslarve](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/e480ec/32.png) [@jslarve](https://clarionhub.com/u/jslarve)\
**Post date:** [January 13, 2025, 8:31pm UTC](https://clarionhub.com/t/keyboard-handler-in-clarion/7833/5 "2025-01-13T20:31:00Z")

</div>

If this is a result of using the debugger, there is a ClaDBNe.exe that does not require elevation.

---

<div class="post-metadata">

**Author:** ![PurpleEdge2214](https://clarionhub.com/user_avatar/clarionhub.com/purpleedge2214/32/5109_2.png) [@PurpleEdge2214](https://clarionhub.com/u/PurpleEdge2214)\
**Post date:** [January 13, 2025, 11:43pm UTC](https://clarionhub.com/t/keyboard-handler-in-clarion/7833/6 "2025-01-13T23:43:32Z")

</div>

So what you are hoping to see is a number entered then tab to the next field, number entered tab to next field etc?

Maybe as a first check, see what value is in the first field when the color reader sends its stuff, in the event:Accepted for the field.

Could it be that the field is a numeric only field and the value supplied is being rejected by the field? That would be my first guess. Maybe let us know if the field is numeric or a string. If numeric I’d try using string fields.

---

<div class="post-metadata">

**Author:** ![vitesse](https://clarionhub.com/user_avatar/clarionhub.com/vitesse/32/837_2.png) [@vitesse](https://clarionhub.com/u/vitesse)\
**Post date:** [January 14, 2025, 5:27am UTC](https://clarionhub.com/t/keyboard-handler-in-clarion/7833/7 "2025-01-14T05:27:39Z")

</div>

In addition to what everyone else has said, I would input the numbers in to notepad (that you mentioned worked OK) and then save that to an ASCII text file then view the contents in hex.

Just to confirm it is sending what you expect. (are the TABs really ‘\<9\>’ ?)

The next step would be a simple Clarion window with just a text/memo field and try that.

Anyway let us know how you progress. I have not used a color reader but years ago had barcode readers that did this and they worked perfectly.

---

<div class="post-metadata">

**Author:** ![johan\_rademan](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/ea666f/32.png) [@johan\_rademan](https://clarionhub.com/u/johan_rademan)\
**Post date:** [January 14, 2025, 6:27am UTC](https://clarionhub.com/t/keyboard-handler-in-clarion/7833/8 "2025-01-14T06:27:41Z")

</div>

Hi,

Perhaps the obvious but have you looked at the Keyboard() clarion function?  
Something in received in the buffer is possibly invalid for clarion and then does not display it

Johan

---

<div class="post-metadata">

**Author:** ![Jim-Morgan](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@Jim-Morgan](https://clarionhub.com/u/Jim-Morgan)\
**Post date:** [January 15, 2025, 1:57pm UTC](https://clarionhub.com/t/keyboard-handler-in-clarion/7833/9 "2025-01-15T13:57:25Z")

</div>

Thanks for thoughts. The program does not run elevated. I’ve used bar code readers without issue. The keyboard() function does not see the input. There are no events generated.

---

<div class="post-metadata">

**Author:** ![FominTools](https://clarionhub.com/user_avatar/clarionhub.com/fomintools/32/3634_2.png) [@FominTools](https://clarionhub.com/u/FominTools)\
**Post date:** [January 15, 2025, 2:21pm UTC](https://clarionhub.com/t/keyboard-handler-in-clarion/7833/10 "2025-01-15T14:21:48Z")

</div>

> [@Jim-Morgan](#):
>
> It simulates manual keyboard entry. The input is number tab number tab number tab. The numbers come in as expected in a browser app, Excel and notepad, but not the Clarion

If we are talking about Clarion for Windows, the Tab key press typically mean go to the next entry field in a form…

One more thought. You can emulate the emulated sequence using your real keyboard to test if your Clarion program works as expected. Either one (program or expectation) may be wrong.

---

<div class="post-metadata">

**Author:** ![PurpleEdge2214](https://clarionhub.com/user_avatar/clarionhub.com/purpleedge2214/32/5109_2.png) [@PurpleEdge2214](https://clarionhub.com/u/PurpleEdge2214)\
**Post date:** [January 16, 2025, 12:24am UTC](https://clarionhub.com/t/keyboard-handler-in-clarion/7833/11 "2025-01-16T00:24:43Z")

</div>

> [@Jim-Morgan](#):
>
> There are no events generated.

Well, I guess Clarion isn’t reading the input from the device? How is it connected to the machine, what sort of port?

PS: You haven’t said what sort of entry field you are using?

---

<div class="post-metadata">

**Author:** ![Jim-Morgan](https://clarionhub.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@Jim-Morgan](https://clarionhub.com/u/Jim-Morgan)\
**Post date:** [January 16, 2025, 8:01pm UTC](https://clarionhub.com/t/keyboard-handler-in-clarion/7833/12 "2025-01-16T20:01:49Z")

</div>

If you position the cursor in a number field or notes field in Clarion, it does not matter. It’s a bluetooth connected device that’s supposed to feed the keyboard buffer as if the user was typing. It works fine in any other Windows program that I tested or inside a browser.

---

<div class="post-metadata">

**Author:** ![pepe](https://clarionhub.com/letter_avatar_proxy/v4/letter/p/4da419/32.png) [@pepe](https://clarionhub.com/u/pepe)\
**Post date:** [January 17, 2025, 10:07am UTC](https://clarionhub.com/t/keyboard-handler-in-clarion/7833/13 "2025-01-17T10:07:22Z")

</div>

I think it is a problem with TAB key character.  
You can try ALIAS(TABKey,SPACEKey) before opening window,

Petar
