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

Option for number row to turn into symbols with shift #558

Closed
K4sum1 opened this issue Mar 14, 2024 · 6 comments
Closed

Option for number row to turn into symbols with shift #558

K4sum1 opened this issue Mar 14, 2024 · 6 comments
Labels
enhancement New feature or request low priority This issue is unlikely to be resolved in the near future due to maintainers' priorities PR Contributors are encouranged to submit a pull request. Just ask in case you are interested.

Comments

@K4sum1
Copy link

K4sum1 commented Mar 14, 2024

Is your feature request related to a problem? Please describe.
When typing, I like to use symbols sometimes. I do have the long press keys for symbols option enabled, but it's more confusing when I can just press Shift on Gboard and just have symbols in the layout of any standard PC keyboard replace the numbers.

Describe the solution you'd like
An option that I can enable that enables this. You would have to be careful in implementing it though. Gboard is smart enough to not switch the number row at the beginning of a sentence where it's capitalized by default. It has to be only when the user presses Shift.

Use case
If I'm typing percentages like 90%, (doing this), @'ing someone, typing dollar amounts like $70, or really using any commonly used symbols, it's more convenient.

Describe alternatives you've considered
I do have the show hints option enabled, but if I want to type a percentage, I know from well over a decade of using computer keyboards that it's Shift and 5. Gboard works similarly, press Shift, and 5 becomes %. HeliBoard, if I press shift, I still have numbers. I could look at the hints and long press q, or go to the symbols keyboard, but that takes longer and doesn't match already established computer keyboards.

Additional context
HeliBoard:
IMG_20240314_141520

Gboard:
IMG_20240314_141540

@K4sum1 K4sum1 added the enhancement New feature or request label Mar 14, 2024
@Helium314 Helium314 added PR Contributors are encouranged to submit a pull request. Just ask in case you are interested. low priority This issue is unlikely to be resolved in the near future due to maintainers' priorities labels Mar 15, 2024
Helium314 added a commit that referenced this issue Aug 26, 2024
so users can do #558 themselves
@Helium314
Copy link
Owner

You can do this yourself now (next release) by customizing the number row layout, and using a json layout with a shift_state_selector, e.g.

    { "$": "shift_state_selector",
      "manualOrLocked": { "label": "!" },
      "default": { "label": "1" }
    }

@K4sum1
Copy link
Author

K4sum1 commented Jan 23, 2025

You can do this yourself now (next release) by customizing the number row layout, and using a json layout with a shift_state_selector, e.g.

    { "$": "shift_state_selector",
      "manualOrLocked": { "label": "!" },
      "default": { "label": "1" }
    }

So I upgraded to 2.3 now and I'm not sure how to do this.
I make like a sihft_state_selector.json I assume, but is it just that for every key? I'm also not sure how to import it.

@Helium314
Copy link
Owner

I did not test, but it should work if you edit the number row and add something like

[[
    { "$": "shift_state_selector",
      "manualOrLocked": { "label": "!" },
      "default": { "label": "1" }
    },
    { "$": "shift_state_selector",
      "manualOrLocked": { "label": "!" },
      "default": { "label": "1" }
    },
    { "$": "shift_state_selector",
      "manualOrLocked": { "label": "!" },
      "default": { "label": "2" }
    },
    { "$": "shift_state_selector",
      "manualOrLocked": { "label": "!" },
      "default": { "label": "3" }
    },
    { "$": "shift_state_selector",
      "manualOrLocked": { "label": "!" },
      "default": { "label": "4" }
    },
    { "$": "shift_state_selector",
      "manualOrLocked": { "label": "!" },
      "default": { "label": "5" }
    },
    { "$": "shift_state_selector",
      "manualOrLocked": { "label": "!" },
      "default": { "label": "6" }
    },
    { "$": "shift_state_selector",
      "manualOrLocked": { "label": "!" },
      "default": { "label": "7" }
    },
    { "$": "shift_state_selector",
      "manualOrLocked": { "label": "!" },
      "default": { "label": "8" }
    },
    { "$": "shift_state_selector",
      "manualOrLocked": { "label": "!" },
      "default": { "label": "9" }
    },
    { "$": "shift_state_selector",
      "manualOrLocked": { "label": "!" },
      "default": { "label": "0" }
    }
]]

So it's one shift_state_selector per key. Also the double [[ are required as far as I remember, because the parser expects multiple rows.

@EduRGB
Copy link

EduRGB commented Feb 10, 2025

So I upgraded to 2.3 now and I'm not sure how to do this. I make like a sihft_state_selector.json I assume, but is it just that for every key? I'm also not sure how to import it.

Just go the settings: Advanced>Customize symbols and number layouts>Number row.
And paste this:

[
  [
    {
      "$": "shift_state_selector",
      "manualOrLocked": { "label": "!" },
      "default": { "label": "1" }
    },
    {
      "$": "shift_state_selector",
      "manualOrLocked": { "label": "@" },
      "default": { "label": "2" }
    },
    {
      "$": "shift_state_selector",
      "manualOrLocked": { "label": "#" },
      "default": { "label": "3" }
    },
    {
      "$": "shift_state_selector",
      "manualOrLocked": { "label": "$" },
      "default": { "label": "4" }
    },
    {
      "$": "shift_state_selector",
      "manualOrLocked": { "label": "%" },
      "default": { "label": "5" }
    },
    {
      "$": "shift_state_selector",
      "manualOrLocked": { "label": "^" },
      "default": { "label": "6" }
    },
    {
      "$": "shift_state_selector",
      "manualOrLocked": { "label": "&" },
      "default": { "label": "7" }
    },
    {
      "$": "shift_state_selector",
      "manualOrLocked": { "label": "*" },
      "default": { "label": "8" }
    },
    {
      "$": "shift_state_selector",
      "manualOrLocked": { "label": "(" },
      "default": { "label": "9" }
    },
    {
      "$": "shift_state_selector",
      "manualOrLocked": { "label": ")" },
      "default": { "label": "0" }
    }
  ]
]

@K4sum1
Copy link
Author

K4sum1 commented Feb 10, 2025

I wonder if it would be possible to keep the long press items too. Pasting that below the default items doesn't work.

For convenience these are the defaults from before I did this.

1 ¹ ½ ⅓ ¼ ⅛
2 ² ⅔
3 ³ ¾ ⅜
4 ⁴
5 ⁵ ⅝
6 ⁶
7 ⁷ ⅞
8 ⁸
9 ⁹
0 ⁰ ⁿ ∅

@EduRGB
Copy link

EduRGB commented Feb 11, 2025

Right, here it is with popups and shift-key functionality:

[
  [
    {
      "$": "shift_state_selector",
      "manualOrLocked": { "label": "!" },
      "default": { 
        "label": "1", 
        "popup": { 
          "relevant": [ 
            { "label": "¹" }, { "label": "½" }, { "label": "" }, { "label": "¼" }, { "label": "" } 
          ] 
        } 
      } 
    },
    {
      "$": "shift_state_selector",
      "manualOrLocked": { "label": "@" },
      "default": { 
        "label": "2", 
        "popup": { 
          "relevant": [ 
            { "label": "²" }, { "label": "" } 
          ] 
        } 
      } 
    },
    {
      "$": "shift_state_selector",
      "manualOrLocked": { "label": "#" },
      "default": { 
        "label": "3", 
        "popup": { 
          "relevant": [ 
            { "label": "³" }, { "label": "¾" }, { "label": "" } 
          ] 
        } 
      } 
    },
    {
      "$": "shift_state_selector",
      "manualOrLocked": { "label": "$" },
      "default": { 
        "label": "4", 
        "popup": { 
          "relevant": [ 
            { "label": "" } 
          ] 
        } 
      } 
    },
    {
      "$": "shift_state_selector",
      "manualOrLocked": { "label": "%" },
      "default": { 
        "label": "5", 
        "popup": { 
          "relevant": [ 
            { "label": "" }, { "label": "" } 
          ] 
        } 
      } 
    },
    {
      "$": "shift_state_selector",
      "manualOrLocked": { "label": "^" },
      "default": { 
        "label": "6", 
        "popup": { 
          "relevant": [ 
            { "label": "" } 
          ] 
        } 
      } 
    },
    {
      "$": "shift_state_selector",
      "manualOrLocked": { "label": "&" },
      "default": { 
        "label": "7", 
        "popup": { 
          "relevant": [ 
            { "label": "" }, { "label": "" } 
          ] 
        } 
      } 
    },
    {
      "$": "shift_state_selector",
      "manualOrLocked": { "label": "*" },
      "default": { 
        "label": "8", 
        "popup": { 
          "relevant": [ 
            { "label": "" } 
          ] 
        } 
      } 
    },
    {
      "$": "shift_state_selector",
      "manualOrLocked": { "label": "(" },
      "default": { 
        "label": "9", 
        "popup": { 
          "relevant": [ 
            { "label": "" } 
          ] 
        } 
      } 
    },
    {
      "$": "shift_state_selector",
      "manualOrLocked": { "label": ")" },
      "default": { 
        "label": "0", 
        "popup": { 
          "relevant": [ 
            { "label": "" }, { "label": "" }, { "label": "" } 
          ] 
        } 
      } 
    }
  ]
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request low priority This issue is unlikely to be resolved in the near future due to maintainers' priorities PR Contributors are encouranged to submit a pull request. Just ask in case you are interested.
Projects
None yet
Development

No branches or pull requests

3 participants