You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason will be displayed to describe this comment to others. Learn more.
@eltang - behold! I tested your macro! It did not make the keyboard explode, which is a good thing. But it also didn't work very well, which is not as good of a thing.
I can get parens to send when I hit the Shift key -- but if I hold it for a moment or two, it doesn't do anything. Do you know why?
The reason will be displayed to describe this comment to others. Learn more.
@mecanogrh Why must record->tap.count be compared to zero? It is not always a positive number. It starts counting from zero.
@ezuk The press might not be registered as a tap if you hold the key too long! However, a long press should still register Shift if another key is pressed while that key is held down.
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's what I meant. The perfect implementation would send parentheses
even if I hold down Shift for three minutes, as long as I don't press
anything else in the interim.
On Fri, May 6, 2016, 10:56 Eric Tang ***@***.*** wrote:
@mechanogrh Why must record->tap.count be compared to zero? It is not
always a positive number. It starts counting from zero.
@ezukhttps://github.com/ezuk The press might not be registered as a
tap if you hold the key too long! Check if Shift is still being registered
by your computer, though. That should still be happening.
—
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub
78bd31f#commitcomment-17380841
The reason will be displayed to describe this comment to others. Learn more.
@ezuk I checked the tapping code, and it doesn't currently support the functionality you describe. However, doesn't this implementation already work better than the one it replaces? I forgot to mention to that the parenthesis can be made to repeat by tapping and then immediately holding the key if only a small modification to the code is made!
The reason will be displayed to describe this comment to others. Learn more.
Nope, this implementation feels pretty similar to the one it replaced. And... why would I repeat the parens? Do you find yourself having to type repeated ((((( chars often?
The reason will be displayed to describe this comment to others. Learn more.
Well, it should be better than the one currently in the README, correct? I guess the repetition isn't as important a feature. Should I get some code up here for a key that sends a parenthesis as long as there wasn't an intervening keypress?
The reason will be displayed to describe this comment to others. Learn more.
Might be a nice habit for you to get into, trying the code on a keyboard before you say if something "should" or "should not" be better. You know, stick it in a keymap, compile, flash, test it. Just an idea. ;)
If you'd like to share working, tested code that sends a paren as long as there wasn't an intervening keypress, that'd be awesome!
The reason will be displayed to describe this comment to others. Learn more.
I would, but I don't have a second keyboard that's able to run QMK. It's not too possible for me to run a quick test and get back to what I was doing (with the keyboard).
I can do a preliminary test, but I'll probably take a little longer than if I didn't.
The reason will be displayed to describe this comment to others. Learn more.
I can do a preliminary test, but I'll probably take a little longer than if I didn't.
😆 😆 This quote is gold. Yes, it would take time -- this is what it means to be a pro, to test your work. And Jack and I use our main keyboards to test stuff all the time... you don't need another one. Just assign a key, flash it, see what it does. Not hard :)
The reason will be displayed to describe this comment to others. Learn more.
The thing is, I wasn't using git when I (poorly) wrote the code that powers my current keymap. I tried to apply some later changes to the code and the whole thing just broke. Now, the only working copy of my keymap I have is its .hex file. I really do need to flash an entire new keymap just to run a simple test.
The reason will be displayed to describe this comment to others. Learn more.
Ah, I understand -- that's for explaining @eltang. So here is what you need to do now:
Commit your current keymap to git, even if it is broken. Not as a pull request to this repo, but to your own pull request.
Try to compile it.
Fix the errors you get.
Try to compile it.
Repeat steps 3 and 4 until it compiles.
Flash the result on your keyboard and test it.
Improve it as needed, constantly repeating steps 3-6.
Commit your improvements and open a pull request with your keyboard.
Being able to flash a keyboard with firmware to test it is a basic requirement for contributing to the repo, as I am sure @jackhumbert would agree.
Please let me know once you've done this -- would be good to look at your code as well. I understand if this means you will be a little less available to help others while do this -- that's okay, as fixing your own keymap takes precedence.
78bd31f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@eltang - behold! I tested your macro! It did not make the keyboard explode, which is a good thing. But it also didn't work very well, which is not as good of a thing.
I can get parens to send when I hit the Shift key -- but if I hold it for a moment or two, it doesn't do anything. Do you know why?
78bd31f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is always true here, if you want to test a tap vs an hold you must compare it to an int :)
So if there are no hold handler nothing will happen on hold.
78bd31f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be a little more verbose
tap handler
else
hold handler
78bd31f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh and place the tapping count reset code only in the tap handler, like so
tap handler, do your things then only reset the tapping count
hold handler, useless to reset the tapping count here because it is already at 0!
78bd31f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mecanogrh Why must
record->tap.count
be compared to zero? It is not always a positive number. It starts counting from zero.@ezuk The press might not be registered as a tap if you hold the key too long! However, a long press should still register Shift if another key is pressed while that key is held down.
78bd31f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
78bd31f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ezuk I checked the tapping code, and it doesn't currently support the functionality you describe. However, doesn't this implementation already work better than the one it replaces? I forgot to mention to that the parenthesis can be made to repeat by tapping and then immediately holding the key if only a small modification to the code is made!
78bd31f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope, this implementation feels pretty similar to the one it replaced. And... why would I repeat the parens? Do you find yourself having to type repeated ((((( chars often?
78bd31f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it should be better than the one currently in the README, correct? I guess the repetition isn't as important a feature. Should I get some code up here for a key that sends a parenthesis as long as there wasn't an intervening keypress?
78bd31f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might be a nice habit for you to get into, trying the code on a keyboard before you say if something "should" or "should not" be better. You know, stick it in a keymap, compile, flash, test it. Just an idea. ;)
If you'd like to share working, tested code that sends a paren as long as there wasn't an intervening keypress, that'd be awesome!
78bd31f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would, but I don't have a second keyboard that's able to run QMK. It's not too possible for me to run a quick test and get back to what I was doing (with the keyboard).
I can do a preliminary test, but I'll probably take a little longer than if I didn't.
78bd31f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😆 😆 This quote is gold. Yes, it would take time -- this is what it means to be a pro, to test your work. And Jack and I use our main keyboards to test stuff all the time... you don't need another one. Just assign a key, flash it, see what it does. Not hard :)
78bd31f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thing is, I wasn't using git when I (poorly) wrote the code that powers my current keymap. I tried to apply some later changes to the code and the whole thing just broke. Now, the only working copy of my keymap I have is its .hex file. I really do need to flash an entire new keymap just to run a simple test.
78bd31f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I understand -- that's for explaining @eltang. So here is what you need to do now:
Being able to flash a keyboard with firmware to test it is a basic requirement for contributing to the repo, as I am sure @jackhumbert would agree.
Please let me know once you've done this -- would be good to look at your code as well. I understand if this means you will be a little less available to help others while do this -- that's okay, as fixing your own keymap takes precedence.
Good luck!
78bd31f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At zero tap.count is an hold if it is strictly superior to zero it's a tap.
Then if you don't compare to a value in a conditional, you are testing if the variable is true, true is always returned when the variable is defined.[edit]
In C, as bools are ints, indeed testing a single tap works without operators.
78bd31f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ezuk Here you go. I've tested this.
Put this at the top of your keymap.
Make the macros for your two Shift keys look like this.
Finally, put this at the bottom of your keymap file.
Good luck.
78bd31f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ezuk I added a
break
statement. This macro used my lastcase
label when I tested it, so didn't need it. Sorry about that.78bd31f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @ETLang! Will use this and report ASAP, might take me a few days.
78bd31f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ezuk I forgot to mention that you do not need to call these with
ACTION_MACRO_TAP
.