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

Allow optional hotkeys to be unbound via. config-file #120

Closed
wants to merge 1 commit into from

Conversation

pik
Copy link
Contributor

@pik pik commented Feb 21, 2015

This will allow optional keybinds (all the ones except for the primary tilda key) to be unbound via. a blank string or commenting out the target. The only time config_init will set the optional default keybinds is if the config file did not previously exist.
The slight drawback is that if a user writes a new config without specifying default-keybinds (or letting tilda create the config itself) these keys will not be auto-bound. #110 #113

@Fixles
Copy link

Fixles commented Jun 20, 2015

I was looking for exactly this. I use tmux inside tilda so only a show/hide copy and paste are really useful but cant seem to unbind all the other keysbinds

Currently I just bound all the keys to except the couple I use.

@pik
Copy link
Contributor Author

pik commented Jun 20, 2015

This should be easy to merge into your local copy if you don't mind building from source. I think it's not a very neat solution - which is probably why it hasn't been pulled in.

@Ladicek
Copy link

Ladicek commented May 6, 2016

Is there something I can do to make this (or another solution to the same problem) merged? I see that there's e.g. a bunch of whitespace changes in this PR that obscure what's really going on.

I'm not really a C / GTK programmer, but I feel comfortable doing some minor things.

@pik
Copy link
Contributor Author

pik commented May 8, 2016

@Ladicek Tilda sets up default config values on load of it can't find user set ones, unfortunately atm libconfuse doesn't provide us with a way to distinguish an unset value for an existing key e.g. foo= from simply an empty file.

This patch got around the issue by checking if a config file exists and assuming keys with NULL values are intentionally unset if it does. You could cherry-pick it for personal use.

The proper way to do this I think, especially now that libconfuse has a new maintainer would be to provide a distinct VALUE_UNSET or something along those lines when parsing foo= but that might also have some complications since it will mean libconfuse would have to parse into a value holding structure rather then directly into a basic type as it does atm.

lanoxx added a commit that referenced this pull request Dec 19, 2020
@lanoxx
Copy link
Owner

lanoxx commented Dec 20, 2020

I finally had time to pick up this pull and take a closer look. I have rebased the code and took a slightly different approach that is inspired by #113, personally I prefer the solution of storing "NULL" in the config instead of storing empty strings in the config because that is causing the config value to be commented out and requires that we change the config system to manually initialise default values. In addition, I made a change in the keybinding code to display an empty string instead of the "NULL" special value, when the keybinding is unset.

@lanoxx
Copy link
Owner

lanoxx commented Dec 20, 2020

image

@lanoxx lanoxx closed this in 1761213 Dec 21, 2020
@aacebedo
Copy link

Hi
I got an issue when trying to disable a keybinding.
On 1.5.4 setting NULL as a keybinding in the config file works however if I edit the configuration through the window, I receive a message about an invalid keybinding and I cannot close it

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.

5 participants