keyboard: Handle number/phone input purposes specifically
Add OSK keymaps for these, with the special keys necessary to type numbers(positive, negative, fractional, ...) and phone numbers (with */+/#) Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/6550 Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3162>
This commit is contained in:
parent
32ada34e1d
commit
b78b61a0be
@ -44,7 +44,9 @@
|
||||
<file>my.json</file>
|
||||
<file>nl.json</file>
|
||||
<file>no.json</file>
|
||||
<file>number.json</file>
|
||||
<file>ph.json</file>
|
||||
<file>phone.json</file>
|
||||
<file>pl.json</file>
|
||||
<file>pt.json</file>
|
||||
<file>ro.json</file>
|
||||
|
95
data/osk-layouts/number.json
Normal file
95
data/osk-layouts/number.json
Normal file
@ -0,0 +1,95 @@
|
||||
{
|
||||
"levels": [
|
||||
{
|
||||
"level": "",
|
||||
"mode": "default",
|
||||
"rows": [
|
||||
[
|
||||
{
|
||||
"strings": [
|
||||
"7"
|
||||
]
|
||||
},
|
||||
{
|
||||
"strings": [
|
||||
"8"
|
||||
]
|
||||
},
|
||||
{
|
||||
"strings": [
|
||||
"9"
|
||||
]
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"iconName": "edit-clear-symbolic"
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"strings": [
|
||||
"4"
|
||||
]
|
||||
},
|
||||
{
|
||||
"strings": [
|
||||
"5"
|
||||
]
|
||||
},
|
||||
{
|
||||
"strings": [
|
||||
"6"
|
||||
]
|
||||
},
|
||||
{
|
||||
"iconName": "keyboard-enter-symbolic",
|
||||
"keyval": "0xff0d",
|
||||
"height": 2
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"strings": [
|
||||
"1"
|
||||
]
|
||||
},
|
||||
{
|
||||
"strings": [
|
||||
"2"
|
||||
]
|
||||
},
|
||||
{
|
||||
"strings": [
|
||||
"3"
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"strings": [
|
||||
"-",
|
||||
"+",
|
||||
"E"
|
||||
]
|
||||
},
|
||||
{
|
||||
"strings": [
|
||||
"0"
|
||||
]
|
||||
},
|
||||
{
|
||||
"strings": [
|
||||
".",
|
||||
","
|
||||
]
|
||||
},
|
||||
{
|
||||
"action": "hide",
|
||||
"iconName": "keyboard-hide-symbolic"
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
"name": "Numeric Keyboard"
|
||||
}
|
93
data/osk-layouts/phone.json
Normal file
93
data/osk-layouts/phone.json
Normal file
@ -0,0 +1,93 @@
|
||||
{
|
||||
"levels": [
|
||||
{
|
||||
"level": "",
|
||||
"mode": "default",
|
||||
"rows": [
|
||||
[
|
||||
{
|
||||
"strings": [
|
||||
"7"
|
||||
]
|
||||
},
|
||||
{
|
||||
"strings": [
|
||||
"8"
|
||||
]
|
||||
},
|
||||
{
|
||||
"strings": [
|
||||
"9"
|
||||
]
|
||||
},
|
||||
{
|
||||
"action": "delete",
|
||||
"iconName": "edit-clear-symbolic"
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"strings": [
|
||||
"4"
|
||||
]
|
||||
},
|
||||
{
|
||||
"strings": [
|
||||
"5"
|
||||
]
|
||||
},
|
||||
{
|
||||
"strings": [
|
||||
"6"
|
||||
]
|
||||
},
|
||||
{
|
||||
"iconName": "keyboard-enter-symbolic",
|
||||
"keyval": "0xff0d",
|
||||
"height": 2
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"strings": [
|
||||
"1"
|
||||
]
|
||||
},
|
||||
{
|
||||
"strings": [
|
||||
"2"
|
||||
]
|
||||
},
|
||||
{
|
||||
"strings": [
|
||||
"3"
|
||||
]
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"strings": [
|
||||
"*"
|
||||
]
|
||||
},
|
||||
{
|
||||
"strings": [
|
||||
"0",
|
||||
"+"
|
||||
]
|
||||
},
|
||||
{
|
||||
"strings": [
|
||||
"#"
|
||||
]
|
||||
},
|
||||
{
|
||||
"action": "hide",
|
||||
"iconName": "keyboard-hide-symbolic"
|
||||
}
|
||||
]
|
||||
]
|
||||
}
|
||||
],
|
||||
"name": "Phone"
|
||||
}
|
@ -1391,10 +1391,12 @@ export const Keyboard = GObject.registerClass({
|
||||
y_expand: true,
|
||||
});
|
||||
|
||||
if (purpose === Clutter.InputContentPurpose.DIGITS ||
|
||||
purpose === Clutter.InputContentPurpose.NUMBER ||
|
||||
purpose === Clutter.InputContentPurpose.PHONE) {
|
||||
if (purpose === Clutter.InputContentPurpose.DIGITS) {
|
||||
keyboardModel = new KeyboardModel('digits');
|
||||
} else if (purpose === Clutter.InputContentPurpose.NUMBER) {
|
||||
keyboardModel = new KeyboardModel('number');
|
||||
} else if (purpose === Clutter.InputContentPurpose.PHONE) {
|
||||
keyboardModel = new KeyboardModel('phone');
|
||||
} else {
|
||||
let groups = [groupName];
|
||||
if (groupName.includes('+'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user