# Ctrl + Shift Triggers repeat but not by themselves

So when it press just shift, all good
Just ctrl…also good
press both and it goes into key repeat…why?

global variable mf (modifier flag) is an integer which uses bit maths to indicate key state

Shift = 1
Ctrl = 2
Alt = 4

I have conditional rules in each for a key on and key off as follows

Log ‘Shift’
mf=mf
zz=mf&1
if zz!=0 then exit rules, skip Outgoing Action
mf=mf^1

So while shift is held, it should ignore any repeated keys…right?

mf=mf will do nothing but show the value if you have rules turned on.

zz=mf&1 will make zz=non zero if mf=1. If mf==2 or 4 then zz will still be non-zero but may be 5 ,3 or 7 depending on state of control and alt.

mf=mf^1 will toggle bit zero of mf so bit zero will be different every time it is executed.

Typically to set a bit your move it into position

rr=1<<pp (where pp is the position)

if you want to set it.
mf=mf|rr

if you want to reset it
rr=rr^-1
//The above sets all zeros to 1 and all 1s to zero (one’s compliment)
// Then AND IT with the existing value
mf=mf&rr

See this post.

To make a call on whether your translators are correct, I’d have to see the excerpts from your project file that deal with the setting and resetting of these bits.

The outgoing action if a key stroke should determine if the key repeats or not.

Steve Caldwell
Bome Customer Care

Also available for paid consulting services: bome@sniz.biz

Cheers Steve
Correct, I just use it for simple logging; easier that log and easier to read back later

All of the code is working correctly…thats not my issue; I learnt bit masing in MTP about 15 year ago lol prob still around the old forum somewhere…and have been using bit masks since about 93 in computer science

My question simply…Why is there a key repeat happening when both keys are held and not singularly…?

I’d have to look at the project file.

Steve Caldwell
Bome Customer Care

Also available for paid consulting services: bome@sniz.biz
1 Like

Also are you on Mac or PC? Mac and PC keys have different quirks on their behavior. My objective would be to look at your project and try to duplicate it. An excerpt of the project with just the failing functions would help me focus on the problem instead of trying to decipher the entire project.

Steve Caldwell
Bome Customer Care

Also available for paid consulting services: bome@sniz.biz

Steve

Here is the export of the 2 presets without the init as there is only really 1 global
KB Modifiers - End (1).txt (1.3 KB)
KB Modifiers - Start (1).txt (792 Bytes)

They are fully encapsulated and only scope out via globals atm

You can’t just remove all translators but the ones that are broken and send as a new .bmtp file? To test this I would need to create a new .bmtp file from text that you sent.

Steve

Sure…I remember there was a way to send just presets…hmm or dreaming.
Here is the stripped out version
Repeat.bmtp (6.0 KB)

Ah, this appears to be a WIndows issue. If you hold down control and repeat together, Windows determines that the keystroke should be repeated. I can test this by changing the keyboard properties however it appears there is no way to completely stop from repeating with this combination.

Here is my default rate of my keyboard and it repeats fast.

However if I change it to this, it repeats slowly.

So essentially this confirm that the behavior is within Windows and not Bome MIDI Translator.

I suspect that we will have to figure a different way to handle control and shift operations together or use a different set of keys to make it work. I searched on the web and could not find a way for Windows 10 to stop repeating keys entirely. Maybe you will have better luck. Otherwise, maybe in Bome MIDI Translator we will need to ignore repeated shifts if control is held down and visa versa.

Ideally I would like to figure out how to fix this in Windows though.

Steve Caldwell
Bome Customer Care

Also available for paid consulting services: bome@sniz.biz

Thanks Steve
Thats why I was simply using flags but you are def correct, the OS should deal with it as its ok with just a single qualifier

Alternatively, you may just add rules to disable repeated keystrokes.

See first 3 rules in 1.0 and 1.2

However this may mess up your original intent.

Repeat-sjc.bmtp (6.1 KB)

Steve Caldwell
Bome Customer Care

Also available for paid consulting services: bome@sniz.biz

You might want to mess around with Windows ‘Filterkeys’ but I haven’t found a way yet to disable all repeating keystrokes.

Yeah its global, you can actualy filter single qualifiers