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

Bug: it's very difficult to switch tabs on my keyboard layout #64

Closed
Jackymancs4 opened this issue Aug 4, 2020 · 6 comments
Closed
Labels
bug Something isn't working question Further information is requested
Milestone

Comments

@Jackymancs4
Copy link

Hello @makeworld-the-better-one
I was trying the tab switch feature with 3 and 24 tabs but only number 8 and number 2 was able to being selected.

In the source here https://github.com/makeworld-the-better-one/amfora/blob/2d99db371d835ef0a789748c66fcb34049463180/display/display.go#L365-L396
I see that you hardcoded the symbol results of a SHIFT-NUMBER combo, but that only works for some keyboard layout. Mine (an italian Macbook keyboard) is

  1. !
  2. "
  3. £
  4. $
  5. %
  6. &
  7. /
  8. (
  9. )
  10. =

Unfortunately, this make the tabs practically unusable without looking at the source (or a lot of trial and error).

@makew0rld makew0rld added the bug Something isn't working label Aug 4, 2020
@makew0rld makew0rld added this to the v1.5.0 milestone Aug 4, 2020
@makew0rld
Copy link
Owner

makew0rld commented Aug 4, 2020

This is a great point, I forget about how the order is different in other countries/languages, even the UK I think. Unfortunately, there's no quick fix. Ctrl+NUM and Alt+NUM are not supported in the terminal.

What if the config file there was a setting like:

shiftnumbers = "!@#$%^&*()"

So you can configure that by holding down Shift and pressing numbers 1 through 0. It would be default set to US layout, but anyone could change it. How does that sound?

@Jackymancs4
Copy link
Author

That would work, and surely would solve my problem but I honestly have to say it feels a little cumbersome.

Maybe you could investigate the possibility to infer those keys from the keyboard layout itself. This package for examble seems able to do it:

https://github.com/atom/keyboard-layout

The package is for node, but the implementation is actually C. It could provide some inspiration. Maybe.

Also, I think a worthy enhancement could be to add the ability to customize all the shortcuts in the configuration file in the same fashion as the recent theming.

All of this does not solve a bigger underlying problem. The way I understand it, there is no actual way to go to any tab beyond the 9th tab (except if it's the last one), but I can create as many as I crave by abusing ctrl+t

A possible solution (that would make the shift-NUM at least less important) could be to add two cycle-tab shortcuts like:

  1. ctrl+( -> Previous Tab (if first, go to the last)
  2. ctrl+) -> Next Tab (if last, go to the first)

Obviously, those are only my thoughts/opinions.

@makew0rld
Copy link
Owner

Thanks for the link. That solution looks difficult to implement on first glance, and seemingly relies on C libraries, different for each OS. Also Amfora supports OSes that doesn't cover. For now I will implement the solution I mentioned above.

Also, I think a worthy enhancement could be to add the ability to customize all the shortcuts in the configuration file in the same fashion as the recent theming.

Yes, possibly in the future. For now I will leave it as it is.

The way I understand it, there is no actual way to go to any tab beyond the 9th tab (except if it's the last one), but I can create as many as I crave

Good catch, damn. I will add a shortcut to fix this. Unfortunately the ones you suggested are not available. For example, on the Guake terminal, they will just output 9 and 0 respectively.

makew0rld added a commit that referenced this issue Aug 6, 2020
@makew0rld
Copy link
Owner

makew0rld commented Aug 6, 2020

I have implemented the shift_numbers solution in 70438cf. I'm thinking about using - and = for tab navigation.

Edit: I chose those characters because they are on the top row on US and UK keyboard layouts. But that still wouldn't work for your Italian keyboard. I could add another config value for this, possibly.

@makew0rld makew0rld added the question Further information is requested label Aug 6, 2020
makew0rld added a commit that referenced this issue Aug 6, 2020
@makew0rld
Copy link
Owner

For now I've added F1 and F2 for tab navigation, as they are keyboard agnostic. Commit: 5cb629f

I am going to close this issue, but feel free to let me know if you have a different keybinding that would work better. Thanks for your interest in Amfora!

@Jackymancs4
Copy link
Author

I was able to test your fixes today. Amfora works flawlessly now, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants