Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
/captures
.release
/release
release-assets/
.externalNativeBuild
.cxx
local.properties
Expand Down
36 changes: 35 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,40 @@
# Changelog

## Pastiera Enhanced 4.1

Builds on this branch are posted here first for faster troubleshooting and testing. These changes are intended to be split into pull requests against the main Pastiera branch once they are stable enough for upstream review.

### Added
- Per-app keyboard themes for hardware and software keyboard modes.
- Searchable per-app theme manager with overridden apps pinned to the top.
- Direct theme picker for each app override.
- Saved theme clone, rename, and delete actions.

### Improved
- Key Tap color now drives accent-style keyboard highlights more consistently.
- Per-app overrides can link to saved themes, so app themes update when the saved theme is edited.
- Emoji picker Media tab stays available even when the separate GIF SYM page is disabled.

## Pastiera Enhanced 4.0

Pastiera Enhanced 4.0 is a rewrite of the Enhanced fork on top of the newer upstream Pastiera base.

Builds on this branch are posted here first for faster troubleshooting and testing. These changes are intended to be split into pull requests against the main Pastiera branch once they are stable enough for upstream review.

### Added
- Predictive text integration with next-word predictions, bundled common phrase fallback, local learning, and removable predictions.
- Unified Mode, which can show predictions inside the existing variations/status bar instead of stacking a separate prediction row.
- Snippets with searchable shortcut popups, plus improved emoji/symbol shortcode completion.
- Media picker support inside the emoji picker, including GIFs, stickers, and local images.
- Theme controls for key tap color and modifier strip thickness.

### Fixed and Improved
- Fixed media sending crashes and restored GIF/sticker/image sending fallback behavior.
- Improved prediction replacement after selecting suggestions and advanced predictions after accepted words.
- Improved shortcode/snippet popup theming, sizing, and unified-mode positioning.
- Improved SYM popup layout, symbol page padding, page cycling, and close controls.
- Ported Enhanced behavior onto the newer Pastiera base to make future upstream pull requests easier to split and review.

## New Features Pastiera 0.2

### Keyboard Enhancements
Expand Down Expand Up @@ -30,4 +65,3 @@


*This changelog covers all changes since the last release (v0.1-alpha).*

197 changes: 123 additions & 74 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,121 @@
Donate to the current maintainer:
# Pastiera Enhanced

Pastiera Enhanced is a development/testing fork of [Pastiera](https://github.com/palsoftware/pastiera), an Android input method for physical keyboard devices such as the Unihertz Titan 2.

This fork is kept close to the latest upstream Pastiera base while testing extra features faster before they are split out or merged upstream. The current Enhanced feature set has also been submitted back to the main project as [PR #259](https://github.com/palsoftware/pastiera/pull/259).

## Download

- Latest Pastiera Enhanced builds are posted on the [Releases page](https://github.com/astroboii47/pastiera/releases).
- Install the APK, then enable it from Android Settings -> System -> Languages & input -> Virtual keyboard -> Manage keyboards.
- In-app update checks in this fork point at the Pastiera Enhanced releases while the fork is active.

## What's Included

Pastiera Enhanced 4.x is a rewrite of the Enhanced fork on top of the newer Pastiera base, with the fork-specific features reapplied and cleaned up for testing and upstream review.

### Text, Predictions, and Shortcuts

- Emoji and symbol shortcodes while typing, including inline suggestions and shortcut completion.
- Snippets for quick text shortcuts such as emails, usernames, links, templates, and common phrases.
- Searchable snippet management page.
- Improved predictive text with local next-word learning.
- Bundled common phrase fallback data so predictions are useful before personal learning builds up.
- Unified Mode, which can show predictions in the existing candidate/variation bar instead of stacking a second row.
- Better prediction insertion, including replacing the current word where appropriate and advancing suggestions after accepting a prediction.
- Long-press removal for unwanted prediction suggestions.
- Klipy API key setting under Smart Features, without shipping a default/shared key.

### Emoji, Media, and SYM Pages

- GIF, sticker, and local media support from the emoji/media panel.
- Klipy-powered GIF/sticker search with trending and search results.
- Animated media previews in the picker.
- Tap-to-preview before sending media.
- Rich GIF/sticker sending when the target app supports it.
- Link/file fallback handling for apps that do not accept direct rich content.
- Media tab inside the emoji picker, separate from whether the standalone GIF SYM page is enabled.
- Updated emoji data and search entries, including newer emoji support.
- Optional custom emoji font rendering in the emoji picker and candidate/variation UI.
- Improved emoji, GIF, symbols, clipboard, and SYM popup layout.
- Close buttons and better sizing/padding for emoji and media pages.
- Improved SYM/status bar page cycling and long-press selector behavior.

### Themes and Appearance

- Per-app keyboard themes for hardware and software keyboard modes.
- Searchable per-app theme manager with overridden apps pinned first so they are easy to find again.
- Direct theme picker for each app override, without needing to apply a theme globally first.
- Per-app overrides link to saved themes, so editing a saved theme updates apps using that override.
- Theme clone, rename, and delete actions.
- Separate theme assignment for hardware keyboard and software keyboard modes.
- Fixed, light/dark, and layout/input-style theme override support.
- Expanded color editor for background, dividers, normal keys, special keys, text/icons, suggestions, status buttons, cursor swipe, LEDs, key popups, selected popup keys, and key tap/accent color.
- Alpha slider for theme colors, making translucent/frosted glass styles possible.
- Frost intensity control for keyboard bars and popups.
- User-adjustable key tap/accent color that also drives accent-style highlights across more of the keyboard UI.
- User-adjustable modifier indicator strip thickness.
- User-adjustable key corner radius and keyboard chrome corner radius.
- User-adjustable suggestions row height and variations row height.
- Software keyboard geometry controls, including key height, number row height, key width, row gap, horizontal spacing behavior, and ortholinear layout.
- Popup styling controls for attached/floating key popups, popup tails, key preview timing, and alternate-key popups.
- Candidate, variation, status, shortcut popup, snippet popup, emoji/media, and software keyboard colors follow the selected keyboard theme more consistently.
- Better handling for popup translucency so snippet/shortcode pages stay readable even with frosted themes.

### Hardware Keyboard, Deleting, and Titan 2 Polish

- Configurable Shift/Alt/Ctrl + Backspace delete behavior, including normal, word, and line delete modes.
- Configurable SYM/F12 + Backspace delete behavior where supported by the device/keymap path.
- Modifier indicators can be shown in the bottom strip, Android menu/status area, Pastiera statusbar, or turned off.
- LED/status colors for active and locked modifier states follow the selected theme.
- Larger emoji picker option for easier browsing on compact hardware-keyboard devices.
- Improved SYM/status bar page cycling and long-press selector behavior for faster page switching.
- Media tab remains available inside the emoji picker even when the separate GIF SYM page is disabled.
- Tuned for Unihertz Titan 2 usage while keeping Pastiera's configurable layout/profile system.

## Core Pastiera Features

- Compact status bar with LED indicators for Shift/SYM/Ctrl/Alt.
- Variations/suggestions bar with swipe-pad cursor movement.
- Multiple layouts including QWERTY, AZERTY, QWERTZ, Greek, Cyrillic, Arabic, translit, and Titan 2-specific Alt maps.
- JSON import/export for layouts and editable SYM/Ctrl mappings.
- Clipboard support with multiple entries and pinned items.
- Dictionary-based suggestions/autocorrection, substitutions, user dictionary, and Pastiera Recipes.
- Nav Mode and customizable physical-key shortcuts.
- Backup/restore for settings, layouts, variations, SYM/Ctrl maps, and dictionaries.

## Klipy API Setup

GIF, sticker, and online media search uses Klipy. This fork does not ship a default Klipy API key, so users need to add their own key if they want online media search.

1. Get a Klipy API key from Klipy.
2. Open Pastiera Enhanced settings.
3. Go to Smart Features.
4. Open Klipy API key.
5. Paste your key and save.

Local media picking does not require a Klipy API key.

## Custom Emoji Fonts

Pastiera Enhanced can render the emoji picker and candidate/variation emoji with an optional custom emoji font. Add a compatible emoji TTF from settings and make sure you have the right to use any font you import.

## Requirements

- Android 10 (API 29) or higher.
- A physical keyboard device. The fork is mainly tested on Unihertz Titan 2, but the layout system is configurable.

## Support

Support Pastiera Enhanced development:

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/astroboii47)

Support the original Pastiera project:

[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/C0C31OHWF2)

Donate to the current upstream Pastiera maintainer:

Account holder | Patrick Alexander Zauner |
|---|---|
Expand All @@ -9,80 +126,12 @@ Or, for everyone who sees an IBAN and quietly gives up:\
[via PayPal](https://www.paypal.me/zaunerpa)\
`<OpenCollective Profile coming soon>`

Donate to the original developer:\
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/C0C31OHWF2)

# Pastiera

Input method for physical keyboards android devices (e.g. Unihertz Titan 2), designed to make typing faster through shortcuts, gestures, and customization.

## Quick overview
- Compact status bar with LED indicators for Shift/SYM/Ctrl/Alt, variants/suggestions bar, and swipe-pad gestures to move the cursor.
- Multiple layouts (QWERTY/AZERTY/QWERTZ, Greek, Cyrillic, Arabic, translit, etc.) fully configurable; JSON import/export directly from the app. A web frontend for editing layouts is available at https://pastierakeyedit.vercel.app/
- SYM pages usable via touch or physical keys (emoji + symbols), reorderable/disableable, with an integrated layout editor.
- Clipboard support with multiple entries and pinnable items.
- Support for dictionary based suggestions/Autocorrections + swipe gestures to accept a suggestion (requires Shizuku)
- Full backup/restore (settings, layouts, variations, dictionaries), UI translated into multiple languages, and built-in GitHub update checks.

## Typing and modifiers
- Long press on a key can input Alt+key or Shift+Key (uppercase) timing configurable.
- Shift/Ctrl/Alt in one-shot or lock mode (double tap), option to clear Alt on space.
- Current behavior note: `Ctrl` used as a physically held shortcut modifier (e.g. hold `Ctrl` + `A`) intentionally follows the app shortcut path and is not the same flow as Nav Mode (`Ctrl` double-tap latch outside text fields). Nav Mode remains a separate implementation/state.
- Multi-tap support for keys with layout-defined variants (e.g. Cyrillic)
- Standard shortcuts: Ctrl+C/X/V, Ctrl+A, Ctrl+Backspace, Ctrl+E/D/S/F or I/J/K/L for arrows, Ctrl+W/R for selection, Ctrl+T for Tab, Ctrl+Y/H for Page Up/Down, Ctrl+Q for Esc (all customizable in the Customize Nav screen).

## QOL features
- **Nav Mode**: double tap Ctrl outside text fields to use ESDF or IJKL as arrows, and many more useful mappings (everything is customizable in Customize Nav Mode settings)
- **Variations bar as swipe pad**: drag to move the cursor, with adjustable threshold.
- **Launcher shortcuts**: in the launcher, press a letter to open/assign an app.
- **Power shortcuts**: press SYM (5s timeout) then a letter to use the same shortcuts anywhere, even outside the launcher.
- Change language with a tap on language code in the status bar, longpress to enter pastiera settings

## Keyboard layouts
- Included layouts: qwerty, azerty, qwertz, greek, arabic, russian/armenian phonetic translit, plus dedicated Alt maps for Titan 2.
- Layout switching: select from the enabled layouts list (configurable).
- Multi-tap support and mapping for complex characters.
- JSON import/export directly from the app, with visual preview and list management (enable/disable, delete).
- Layout maps are stored in `files/keyboard_layouts` and can also be edited manually. A web frontend for editing layouts is available at https://pastierakeyedit.vercel.app/
- Device/firmware behavior snapshots for physical keyboards are archived under [docs/device-archives](docs/device-archives/).

## Symbols, emoji, and variations
- Two touch-based SYM pages (emoji + symbols): reorderable/enableable, auto-close after input, customizable keycaps.
- In-app SYM editor with emoji grid and Unicode picker.
- Variations bar above the keyboard: shows accents/variants of the last typed letter or static sets (utility/email) when needed.
- Dedicated variations editor to replace/add variants via JSON or Unicode picker; optional static bar.

## Suggestions and autocorrection

- Experimental support for dictionary based autocorrection/suggestions
- User dictionary with search and edit abilities.
- Per-language auto substituion editor, quick search, and a global “Pastiera Recipes” set shared across all languages.
- Change language/keymap with a tap on the language code button or ctrl+space



## Comfort and extra input
- Double space → period + space + uppercase;
- Swipe left on the keyboard to delete a word (Titan 2).
- Optional Alt+Ctrl shortcut to start Google Voice Typing; microphone always available on the variants bar.
- Compact status bar to minimize vertical space. With on-screen keyboard disabled from the IME selector, it uses even less space (aka Pastierina mode)
- Translated UI (it/en/de/es/fr/pl/ru/hy) and onboarding tutorial.

## Backup, updates, and data
- UI-based backup/restore in ZIP format: includes preferences, custom layouts, variations, SYM/Ctrl maps, and user dictionaries.
- Restore merges saved variations with defaults to avoid losing newly added keys.
- Built-in GitHub update check when opening settings (with option to ignore a release).
- Customizable files in `files/`: `variations.json`, `ctrl_key_mappings.json`, `sym_key_mappings*.json`, `keyboard_layouts/*.json`, user dictionaries.
- Android autobackup function

## Installation
1. Build the APK or install an existing build.
2. Android Settings → System → Languages & input → Virtual keyboard → Manage keyboards.
3. Enable “Pastiera” and select it from the input selector when typing.
## Credits

## Requirements
- Android 10 (API 29) or higher.
- Device with a physical keyboard (profiled on Unihertz Titan 2, adaptable via JSON).
- Pastiera Enhanced is based on [Pastiera](https://github.com/palsoftware/pastiera).
- Original Pastiera work and ongoing upstream maintenance belong to the Pastiera project and its contributors.
- Media search is powered by Klipy when the user provides their own API key.
- Emoji metadata/search data is derived from the emoji assets bundled in this repository and updated by the included emoji asset script.

## Development / Tests
- Run core + routing + service modifier regression tests:
Expand Down
13 changes: 7 additions & 6 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ android {
namespace = "it.palsoftware.pastiera"
compileSdk = 36

val defaultVersionCode = 86
val defaultVersionName = "0.86"
val defaultVersionCode = 420
val defaultVersionName = "4.2"
val ciVersionCode = providers.gradleProperty("PASTIERA_VERSION_CODE").orNull?.toIntOrNull()
val ciVersionName = providers.gradleProperty("PASTIERA_VERSION_NAME").orNull
val nightlyVersionCode = providers.gradleProperty("PASTIERA_NIGHTLY_VERSION_CODE").orNull?.toIntOrNull()
Expand Down Expand Up @@ -130,8 +130,8 @@ android {
productFlavors {
create("stable") {
dimension = "channel"
manifestPlaceholders["appLabel"] = "Pastiera"
manifestPlaceholders["imeLabel"] = "Pastiera"
manifestPlaceholders["appLabel"] = "Pastiera Enhanced"
manifestPlaceholders["imeLabel"] = "Pastiera Enhanced"
buildConfigField("String", "RELEASE_CHANNEL", "\"stable\"")
buildConfigField("boolean", "IS_FDROID_BUILD", if (isFdroidBuild) "true" else "false")
buildConfigField("boolean", "ENABLE_GITHUB_UPDATE_CHECKS", if (isFdroidBuild) "false" else "true")
Expand All @@ -143,8 +143,8 @@ android {
versionCode = nightlyVersionCode
}
versionNameSuffix = nightlyVersionNameSuffix
manifestPlaceholders["appLabel"] = "Pastiera Nightly"
manifestPlaceholders["imeLabel"] = "Pastiera Nightly"
manifestPlaceholders["appLabel"] = "Pastiera Enhanced"
manifestPlaceholders["imeLabel"] = "Pastiera Enhanced"
buildConfigField("String", "RELEASE_CHANNEL", "\"nightly\"")
buildConfigField("boolean", "IS_FDROID_BUILD", if (isFdroidBuild) "true" else "false")
buildConfigField("boolean", "ENABLE_GITHUB_UPDATE_CHECKS", if (isFdroidBuild) "false" else "true")
Expand Down Expand Up @@ -262,6 +262,7 @@ dependencies {
implementation(libs.androidx.ui.tooling.preview)
implementation(libs.androidx.material3)
implementation("androidx.appcompat:appcompat:1.6.1")
implementation("androidx.documentfile:documentfile:1.0.1")
implementation("androidx.compose.material:material-icons-extended")
implementation("com.squareup.okhttp3:okhttp:4.11.0")
implementation("androidx.work:work-runtime-ktx:2.9.1")
Expand Down
7 changes: 7 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,12 @@
android:label="@string/online_layouts_title"
android:theme="@style/Theme.Pastiera" />

<activity
android:name=".LocalMediaPickerActivity"
android:exported="false"
android:excludeFromRecents="true"
android:theme="@style/Theme.Pastiera" />

<!-- Activity for trackpad debug -->
<activity
android:name=".TrackpadDebugActivity"
Expand Down Expand Up @@ -202,6 +208,7 @@
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/file_provider_paths" />
</provider>

</application>

</manifest>
2 changes: 1 addition & 1 deletion app/src/main/assets/common/emoji/ACTIVITIES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,4 @@
🧵
🪡
🧶
🪢
🪢
3 changes: 2 additions & 1 deletion app/src/main/assets/common/emoji/ANIMALS_AND_NATURE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -156,4 +156,5 @@
🪹
🪺
🍄
🪾
🪾
🫍
2 changes: 1 addition & 1 deletion app/src/main/assets/common/emoji/FLAGS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -267,4 +267,4 @@
🇿🇼
🏴󠁧󠁢󠁥󠁮󠁧󠁿
🏴󠁧󠁢󠁳󠁣󠁴󠁿
🏴󠁧󠁢󠁷󠁬󠁳󠁿
🏴󠁧󠁢󠁷󠁬󠁳󠁿
2 changes: 1 addition & 1 deletion app/src/main/assets/common/emoji/FOOD_AND_DRINK.txt
Original file line number Diff line number Diff line change
Expand Up @@ -128,4 +128,4 @@
🥄
🔪
🫙
🏺
🏺
4 changes: 3 additions & 1 deletion app/src/main/assets/common/emoji/OBJECTS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -261,4 +261,6 @@
🪬
🗿
🪧
🪪
🪪
🪊
🪎
Loading