Skip to content

Add Or Mode for KeyboardKeyDefinitions - #208

Open
Houdini111 wants to merge 2 commits into
ThoNohT:masterfrom
Houdini111:master
Open

Add Or Mode for KeyboardKeyDefinitions#208
Houdini111 wants to merge 2 commits into
ThoNohT:masterfrom
Houdini111:master

Conversation

@Houdini111

Copy link
Copy Markdown

This PR adds the ability for KeyboardKeyDefinitions to register as being pressed if any of their key codes are pressed (rather than requiring all of them).

In your review I ask for special attention to the last part of the Keyboard Key Pressed logic but I couldn't quite parse what the point of it was. I removed this whole part:

if(kkDef.KeyCodes.Count == 1
	&& allDefs.OfType<KeyboardKeyDefinition>()
		.Any(d => d.KeyCodes.Count > 1
		&& d.KeyCodes.All(kbKeys.Contains)
		&& d.KeyCodes.ContainsAll(kkDef.KeyCodes))) pressed = false;

From what I can understand of it it says it's NOT pressed if there is any keyboard that exactly contains all the same keycodes and those keycodes are pressed? As in it's not allowing multiple to be triggered at the same time?
I don't know why you would want to explicitly disallow that.

I found that in this commit it didn't have that
https://github.com/ThoNohT/NohBoard/blob/4e2965a1bbecf6b2f342aa8f5e71ee5f819549b7/NohBoard/Forms/MainForm.cs
but in this commit it did
8e20028#diff-ddd56594eed44ee72f2d8791249520ccd6802f26bd2a5e7767331930d6598a71
but the commit message implies it was only for edit mode? So I have no idea what the point of it was.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant