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

Define keyboard shortcuts on launch by XML file in %AppData%, and install with WiX #39

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

LawranceFung
Copy link

Installing HuntAndPeck and defining keyboard shortcuts in %AppData% seemed to go hand-in-hand since many applications do both, not just 1. If this makes more sense as 2 separate pull requests I can redo this as 2.
An MSI installer is much more intuitive for non-programmers. Someone who finds Vimium-style hints useful might experience significant confusion over a portable zipped application.
Defining the keyboard shortcuts through XML is useful when they conflict with shortcuts for the active program, such as Visual Studio.

@sd309991
Copy link

Thank you very much, Lawrance!

@LawranceFung
Copy link
Author

Thank you very much, Lawrance!

No problem. This was a feature I had wanted to implement but hadn't gotten around to. ⎇; and ^; both conflict in visual studio.

@zsims
Copy link
Owner

zsims commented Feb 23, 2022

Thanks for raising this PR, really nice work!

Any idea what would need to change in https://github.com/zsims/hunt-and-peck/blob/master/src/build.cake ? (which is used in appveyor to make the build).

@LawranceFung
Copy link
Author

Thanks for raising this PR, really nice work!

Any idea what would need to change in https://github.com/zsims/hunt-and-peck/blob/master/src/build.cake ? (which is used in appveyor to make the build).

Thanks! I have no idea what would be needed to change in cake. Cake has been deprecated so I would use another bootstrapper like WiX or InstallShield. I went with a WiX MSI because it's intuitive for most users, compared to a powershell or cake script.
I don't know anything about Appveyor either. I prefer Jenkins for CI/CD.

@LawranceFung
Copy link
Author

I've worked on keyboard software before, so "Oem1" for semicolon didn't throw me off where it may distracted someone for long enough for some people to quit trying.

@zsims zsims mentioned this pull request Feb 28, 2022
@zsims
Copy link
Owner

zsims commented Feb 28, 2022

Thanks, I'll look at fixing CI so we can spit an installer out.

Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x86 = Debug|x86
Copy link
Owner

Choose a reason for hiding this comment

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

Does this need an x86 config now?

Copy link
Author

Choose a reason for hiding this comment

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

No. Want me to delete it?

Copy link
Author

Choose a reason for hiding this comment

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

It was 2 lines so I pushed the change.

<Import Project="$(WixTargetsPath)" Condition=" '$(WixTargetsPath)' != '' " />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets" Condition=" '$(WixTargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets') " />
<Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixTargetsImported)' != 'true' ">
<Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" />
Copy link
Owner

Choose a reason for hiding this comment

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

Will have to see if this is on circle CI. I don't have access to a Windows environment at the moment 😄

Copy link
Author

Choose a reason for hiding this comment

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

Then how are you testing this?

@zsims
Copy link
Owner

zsims commented Mar 11, 2022

Sorry for the long delay landing this, I'm a bit strapped for time atm. The biggest thing is getting this working with CI (AppVeyor) to spit out an install

@pidgeon777
Copy link

Would it be possible to also save and load the hunt-and-peck configuration locally (same folder of the executable) for portable usages?

@liuxilu
Copy link

liuxilu commented Mar 22, 2022

It's a bad idea to make it installable. Why install this?

@LawranceFung
Copy link
Author

It's a bad idea to make it installable. Why install this?

You don't have to install it. Installation can help for deployment or may be preferred.

@liuxilu
Copy link

liuxilu commented Mar 23, 2022

Unzipping is the best deployment

@pidgeon777
Copy link

So if I understood correctly, placing the XML setting file in the same folder of the hunt-and-peck executable will be enough for loading and storing the configuration?

@liuxilu
Copy link

liuxilu commented Mar 23, 2022

No. A portable settings provider implemention fyi: https://github.com/Bluegrams/SettingsProviders

@weineran
Copy link

weineran commented May 4, 2022

Sorry for the long delay landing this, I'm a bit strapped for time atm. The biggest thing is getting this working with CI (AppVeyor) to spit out an install

Is the CI piece still blocking this PR? If so, would it make sense to split this into separate PRs (one for the installer, one for keyboard shortcuts?

PS I only recently started using hunt-n-peck, but loving it so far. Thanks for building this!

@pidgeon777
Copy link

Hopefully, it will possible to define custom hotkeys for the actions and save the configuration.

Much better than manually starting the executable with the specific switch every time that an action is needed,

@LawranceFung
Copy link
Author

Sorry for the long delay landing this, I'm a bit strapped for time atm. The biggest thing is getting this working with CI (AppVeyor) to spit out an install

Is the CI piece still blocking this PR? If so, would it make sense to split this into separate PRs (one for the installer, one for keyboard shortcuts?

PS I only recently started using hunt-n-peck, but loving it so far. Thanks for building this!

C# defaults to different locations for a configuration file. It's pretty simple, but not quite as simple as cherry picking files/lines.

@LawranceFung
Copy link
Author

Hopefully, it will possible to define custom hotkeys for the actions and save the configuration.

Much better than manually starting the executable with the specific switch every time that an action is needed,

If you really need it now, feel free to clone and compile my fork.

@pidgeon777
Copy link

If you really need it now, feel free to clone and compile my fork.

No, I don't need it now, but it would be a great addition to have in the future for sure 👍.

Merge nullcheck from dharmaturtle
@LawranceFung LawranceFung force-pushed the master branch 2 times, most recently from 5859c64 to d405869 Compare June 25, 2022 20:13
@i-zanis
Copy link

i-zanis commented Sep 7, 2022

Any hopes of having this merged?

@jadedFella
Copy link

I don't think this is gonna get merged now, just start providing releases on your fork OP.

@trifonow22777
Copy link

Guys, I think you can make this work without this PR being submitted (although It will be a good feature).
You just need to make sure to call the entry app with "autohotkey" wrapper script: (I am running autohotkey 1)
launch_hunt_and_peck.ahk

Run "<absolute-url-path>\hap.exe"

#UseHook, On ; <-- This is important

; Change the default shortcuts (Let's say you want `ctrl + ,` instead of `ctrl + ;`)
^,::Send, ^`;

However, this has some limitation, it will still leave ctrl+; + alt+; occupied. If you want them to do something else, you can make some tweaks:

; .. same script
^`;::Send, {enter} ; <-- Just an example

It will still keep the ctrl + ; and alt + ; working in the first example

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.

9 participants