butterfly clicking in mechakeys

I'm a minecraft youtuber and I want butterfly clicking mouse sound instead of normal clicking sounds . Can anyone help me please?
37 Replies
halu
halu2y ago
Just to clarify, are you asking for:
1) a butterfly clicking mouse pack (every click sounds like a butterfly click) 2) butterfly clicking detection (if butterfly clicking, play different sound)
ywzh
ywzhOP2y ago
If butterfly clicking play a different sound like if the cps is above 8 play butterfly clicking sound
halu
halu2y ago
currently not possible* but its under consideration as part of the new event-system and keyboard builder in the experimental section of v2 there's technically a roundabout way to do it in v2, but takes a bit of work
ywzh
ywzhOP2y ago
Can you tell me how to do it? Would be grateful if you help
halu
halu2y ago
Note: you'll need ur own butterfly click sounds sec I'll give a quick write up Concept:
The auxiliary window receives keypress events, which means its possible to roll your own keypress sound system
How: create am html file in the overlays directory and add the following
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title> MechaKeys Overlay </title>
</head>
<script type="module">
// NOTE: the AUDIO REF may be a data uri or local file (maybe)
let butterflyAudio = {
down: new Audio(/*AUDIO REF*/), // click down
up: new Audio(/*AUDIO REF*/) // click up
}
let normalAudio = {
down: new Audio(/*AUDIO REF*/), // click down
up: new Audio(/*AUDIO REF*/) // click up
}

let lastClick = { 1: Date.now(), 2: Date.now() }

API.on('userInput', payload => {
if (payload.type.isKey) return // ignore keypress

const now = Date.now()
let tDiff = now - lastClick?.[payload.button]
lastClick[payload.button] = now

const dir = payload.type.includes('down') ? 'down' : 'up'

if (tDiff < threshold) { // play butterfly
butterflyAudio[dir].play()
} else { // play normal
normalAudio[dir].play()
}
})
</script>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title> MechaKeys Overlay </title>
</head>
<script type="module">
// NOTE: the AUDIO REF may be a data uri or local file (maybe)
let butterflyAudio = {
down: new Audio(/*AUDIO REF*/), // click down
up: new Audio(/*AUDIO REF*/) // click up
}
let normalAudio = {
down: new Audio(/*AUDIO REF*/), // click down
up: new Audio(/*AUDIO REF*/) // click up
}

let lastClick = { 1: Date.now(), 2: Date.now() }

API.on('userInput', payload => {
if (payload.type.isKey) return // ignore keypress

const now = Date.now()
let tDiff = now - lastClick?.[payload.button]
lastClick[payload.button] = now

const dir = payload.type.includes('down') ? 'down' : 'up'

if (tDiff < threshold) { // play butterfly
butterflyAudio[dir].play()
} else { // play normal
normalAudio[dir].play()
}
})
</script>
</html>
this is just a rough guess, idk if its 100% functional This replaces the mechakeys mouse sound system, so be sure to turn that off in settings (have yet to connect settings to the event system) it also uses last click as opposed to some avg speed theres various ways to handle rate detection i didnt define threshold cuz idk wut would be a good val off the top of my head
ywzh
ywzhOP2y ago
Can't we just use the butterfly clicking sounds from mechakeys? Instead of making our own?
halu
halu2y ago
someone has to make em lol
ywzh
ywzhOP2y ago
There is not a pre-made Butterfly clicking sound as you said in the option 1?
halu
halu2y ago
no
ywzh
ywzhOP2y ago
Oh okay no problem
halu
halu2y ago
i mean someone out there might, but idk of any
ywzh
ywzhOP2y ago
Can you tell me which part of the code defines that if the cps is above 8 than use butterfly clicking sound?
halu
halu2y ago
if (tDiff < threshold) { // play butterfly butterflyAudio[dir].play() } you'll prob want to trial and error to find a good threshold number
ywzh
ywzhOP2y ago
Oh ok thank you very much for the help
halu
halu2y ago
the following worked for me
halu
halu2y ago
up to you to find the audio files u want and tweak the threshold value just put that file and the appropriately named audio files in the overlay folder
halu
halu2y ago
then select that overlay
halu
halu2y ago
@fero may wanna check it out as well we should add a few more overlays pain so much to do @fero imma run mechakeys through the overlay system, mechakey-ception
ywzh
ywzhOP2y ago
We have to change the threshold value to a number right? And we have to locate the audio location to the same location?
halu
halu2y ago
@*nothing yea, note that i set threshold to 100 in this linked reply this is the equivalent of 100ms (aka 10 half-clicks per second. i didn't differentiate up vs down when calculating tDiff)
fero
fero2y ago
oh that's really cool lol husk i think we should more comprehensive documentation somewhere setup a git repo with actions to auto build mkdocs or something?
ywzh
ywzhOP2y ago
Is there any other mouse option rather than that one Corsair mouse
halu
halu2y ago
you might find something here, its mostly keyboards tho https://mechvibes.com/sound-packs/
Mechvibes
Custom sound-packs
You can find them here: Custom SoundpacksAll Pack Name,Creator,Pack Description,Tags,Tags,TagsAny submissions through the website will not be added anymore.If you want to submit a pack please do so through our Discord.https://discord.gg/ydZqwvrvYS
ywzh
ywzhOP2y ago
Can we add a audio file without any code or smthing? To the mouse option
halu
halu2y ago
A soundpack builder is in the works, but its not a major priority
ywzh
ywzhOP2y ago
Is mechakeys V2 available in website
fero
fero2y ago
No, and we don't have plans to put it there
ywzh
ywzhOP2y ago
Oh ok
halu
halu2y ago
https://github.com/robolab-io/mechakeys-distro this is our main point of distribution for v2 atm
GitHub
GitHub - robolab-io/mechakeys-distro: Mechakeys V2 – Distribution C...
Mechakeys V2 – Distribution Center. Contribute to robolab-io/mechakeys-distro development by creating an account on GitHub.
halu
halu2y ago
aside from this discord of course
fero
fero2y ago
fero
fero2y ago
fixed it @Halu
halu
halu2y ago
lmfao
ywzh
ywzhOP2y ago
Can u help me as whenever i run mechakeys sensitivity in game feels weird sometimes it goes really up and sometimes really low. It is only happening inside the game
fero
fero2y ago
we're aware of this and are looking into it - can you tell us your system specs and what game youre playing?
ywzh
ywzhOP2y ago
My pc specs are 4gb ram, amd Radeon graphics card, amd athlon silver processor, windows 11, game:- minecraft and average fps around 150-300
halu
halu2y ago
that cant be right, just 4gb of ram?
Want results from more Discord servers?
Add your server