mirror of
https://github.com/RYDE-WORK/ballistica.git
synced 2026-02-08 08:45:43 +08:00
remove built-in special chars from keyboard
This commit is contained in:
parent
04480157c3
commit
3919cfbe37
@ -30,21 +30,7 @@ from typing import TYPE_CHECKING
|
|||||||
import ba
|
import ba
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing import Iterable, List
|
from typing import Dict, Tuple
|
||||||
|
|
||||||
|
|
||||||
def split(chars: Iterable[ba.SpecialChar],
|
|
||||||
maxlen: int) -> List[List[ba.SpecialChar]]:
|
|
||||||
"""Returns ba.SpecialChar groups with a fixed number of elements"""
|
|
||||||
result = []
|
|
||||||
shatter: List[ba.SpecialChar] = []
|
|
||||||
for i in chars:
|
|
||||||
if len(shatter) < maxlen:
|
|
||||||
shatter.append(i)
|
|
||||||
else:
|
|
||||||
result.append(shatter)
|
|
||||||
shatter = [i]
|
|
||||||
return result
|
|
||||||
|
|
||||||
|
|
||||||
# ba_meta export keyboard
|
# ba_meta export keyboard
|
||||||
@ -55,7 +41,4 @@ class EnglishKeyboard(ba.Keyboard):
|
|||||||
('z', 'x', 'c', 'v', 'b', 'n', 'm')]
|
('z', 'x', 'c', 'v', 'b', 'n', 'm')]
|
||||||
nums = ('1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '/', ':',
|
nums = ('1', '2', '3', '4', '5', '6', '7', '8', '9', '0', '-', '/', ':',
|
||||||
';', '(', ')', '$', '&', '@', '"', '.', ',', '?', '!', '\'', '_')
|
';', '(', ')', '$', '&', '@', '"', '.', ',', '?', '!', '\'', '_')
|
||||||
pages = {
|
pages: Dict[str, Tuple[str, ...]] = {}
|
||||||
f'emoji{i}': tuple(ba.charstr(char) for char in page)
|
|
||||||
for i, page in enumerate(split(ba.SpecialChar, len(nums)))
|
|
||||||
}
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user