Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent freq used order change during shift hold #7168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Invertex
Copy link

Addresses #6932

When wanting to click a "Frequently Used" emote multiple times while holding shift, the order will often change between each click, leading to misclicks. Instead I've cached the clicks while Shift is held and then process them after it's no longer held, resulting in order changes only happening after the user lets go of Shift or clicks an emote while not holding shift.

(cache needs to be outside EmoteMenu otherwise we end up losing it during other processing)

Verified

This commit was signed with the committer’s verified signature.
sago2k8 Santiago Jimenez Giraldo
Addresses night#6932

When wanting to click a "Frequently Used" emote multiple times while holding shift, the order will often change between each click, leading to misclicks. Instead I have cached the clicks while Shift is held and then process them after it is no longer held, resulting in changes only happening after the user lets go of Shift or clicks an emote while not holding shift.
@@ -16,6 +16,18 @@ function setKeyPressCallback(newKeyPressCallback) {
keyPressCallback = newKeyPressCallback;
}

const cachedEmoteClicks = new Map();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: pendingEmoteHistory

@@ -56,6 +68,9 @@ export default function EmoteMenu({toggleWhisper, appendToChat, onSetTip}) {
function buttonPressCallback(event) {
setAltPressed(event.altKey);
setShiftPressed(event.shiftKey);
if (!event.shiftKey) {
cacheOrProcessEmoteClicks(null, false);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if the popout is closed via other means (clicking out of the popout or closing it via the X in the upper right), these track events are lost. this operation may need to be in the parent. since appendToChat is a parent function, perhaps the track could be moved there instead.

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.

None yet

2 participants