Page 1 of 1

Bug or Feature?

Posted: Sat Aug 21, 2021 1:28 pm
by G4FKK
Hi Colin,

I've discovered that if you click, for example, the right mouse button and then very quickly click the left, the Langstone acts as if it's received a scroll button click i.e. the lock indicator comes on and the frequency cannot be adjusted. Doing a rapid right/left (or left/right), click turns lock off again. I wonder if this is deliberate or some sort of bug somewhere?

The reason I ask is that I've implemented a 12.5kHz step option on my version of Arduino mouse emulator which is controlled both by a rotary encoder and also a Nextion display. This works as follows...

1) generate 9 right clicks to shift the cursor to the far right digit
2) generate one left click to shift the cursor to the 100Hz digit
3) generate 125 up or down scrolls to shift the frequency up or down 12.5kHz when the rotary encoder is moved one step

Due to the bug-or-feature, the Langstone goes into Lock mode after step 2.

I've fixed my firmware by inserting a 250mS delay between steps 1 and 2. (Anything much less is not enough).

It's obviously not an issue but I'm just interested.

73, Martin - G4FKK

Re: Bug or Feature?

Posted: Sun Aug 22, 2021 10:10 am
by g4eml
Hi. Martin,

The Langstone code will set the dial lock on pressing the middle button or on pressing both buttons together. This is because some people only fitted two buttons to their Langstone.
The ‘both buttons together’ detection is done by detecting button presses within 100ms. In that case a press of one followed rapidly by a press of the other could case the dial lock to be activated which is what is probably happening for you.


If you want to disable the double button detection you would need to edit LangstoneGUI.c and alter a line in the process_mouse() function.

Change

if((mbut==3+128) | (lastBut==3)) //Middle button down or both buttons within 100ms

To

if(mbut==3+128) //Middle button down


Then do a ./build command.



Colin.

Re: Bug or Feature?

Posted: Sun Aug 22, 2021 11:43 am
by G4FKK
Ah! I'd forgotten the pressing-both-buttons-together facility. That explains it perfectly and definitely a feature :) Thanks Colin.

All the best,

Martin

Re: Bug or Feature?

Posted: Sun Aug 22, 2021 2:41 pm
by g4eml
You maybe could try

9 right clicks
2 left clicks
1 right click

That should (may!) result in the dial lock being set and then cleared again.

Colin.

Re: Bug or Feature?

Posted: Sun Aug 22, 2021 9:32 pm
by G4FKK
Yes, that would do the trick Colin and somewhat more elegant than my 250mS delay :)

I'll give it a whirl tomorrow.

Many thanks,

Martin.