Skip to content

Conversation

kpaulisse
Copy link
Contributor

Fixes #194

These are the correct types and annotations for KeyModifiers.

I was able to verify that this works with a small test program:

	params := general.NewTriggerHotkeyByKeySequenceParams()
	params = params.WithKeyId("OBS_KEY_NUMPLUS")
	params = params.WithKeyModifiers(&typedefs.KeyModifiers{Shift: true, Control: true, Alt: true})

	if _, err := client.General.TriggerHotkeyByKeySequence(params); err != nil {
		panic(err)
	}

	time.Sleep(1 * time.Second)

	params2 := general.NewTriggerHotkeyByKeySequenceParams()
	params2 = params.WithKeyId("OBS_KEY_NUMPLUS")
	params2 = params.WithKeyModifiers(&typedefs.KeyModifiers{Shift: true, Control: true, Command: true})

	if _, err := client.General.TriggerHotkeyByKeySequence(params2); err != nil {
		panic(err)
	}

@kpaulisse
Copy link
Contributor Author

Test failures here are also happening in main and don't appear related to my change.

@andreykaipov andreykaipov force-pushed the kpaulisse-fix-KeyModifiers branch from 3923029 to 80b3079 Compare March 18, 2025 17:37
@andreykaipov
Copy link
Owner

Wow I don't know how long these had the wrong json annotation for! Thanks so much!

I had to rebase off main and pushed it up to this PR after merging #196 in so this could pass.

@andreykaipov andreykaipov merged commit 767c10d into andreykaipov:main Mar 18, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

KeyModifiers (TriggerHotkeyByKeySequence) has wrong types

2 participants