Commit Graph

96 Commits (e9ba854ff080e50fb5760f68e878cd3a0dc92f7e)

Author SHA1 Message Date
zwim e9ba854ff0
DeviceMenu: Colons and more information (#8435)
Add information to device menu entries
3 years ago
Aleksa Sarai fb0e5fca94 menu: keyboard_layout: add ability for layout-specific settings
A layout might want to make some specific feature configurable, so
create an addToMainMenu-like system for allowing layouts to add their
own configuration sub-menu to the keyboard configuration menu.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
3 years ago
hius07 2b87b1d8ed
Virtualkeyboard: allow grey'ing the legacy umlaut mode key (#8276)
This key is still available on non-updated keyboard layouts.
3 years ago
hius07 e3cf8eea56
Many widgets: similar size in portrait and landscape (#8238)
- ButtonTable, ButtonDialog, ButtonDialogTitle
- ConfirmBox, MultiConfirmBox, SkimToWidget
- KeyboardLayoutDialog (and initially move the dialog
  down to show the title in landscape mode)
- InputText's Clipboard dialog
Also: Notification: truncate long text
3 years ago
hius07 85cfb552cb
Keyboard preferred layouts: usability fixes (#8159)
Store list of layouts in settings file as array of enabled
layouts only (up to 4 elements). Optimize code.
Allows sorting of the abbreviations in the globe popup:
just check layouts in the desired order (the first checked
will be northeast).
Requires onetime migration to clean up the settings.
3 years ago
NiLuJe 910c0bd250
VirtualKeyBoard: Switch to schedule-less visual feedback for flash_keyboard (#8143)
Should prevent open/close races ;).
3 years ago
hius07 32d61c7878
Virtual keyboard: default layout, compact mode (#8142) 3 years ago
mergen3107 fdae07e2cc
VirtualKeyboard: redesign and enhancements (#8089)
See #8089 for all the details.
3 years ago
hius07 5e2d83965b
InputDialog, InputText: a bunch of updates (#7896)
- New way to hide the VirtualKeyboard: to hide the keyboard
  tap any point of the screen outside the inputbox and above
  the keyboard; to show the keyboard tap the inputbox.
  (Removed hacky "holding the arrow-down key" which is no
  longer needed).
- InputDialog windows are movable/translucent by default
- Redesign of the Clipboard dialog
3 years ago
Frans de Jonge 039947886f
Revert "Hyphenation: add custom hyphenation rules (#7746)" (#7785)
This reverts commit f25da5d0d5.
3 years ago
zwim f25da5d0d5
Hyphenation: add custom hyphenation rules (#7746)
The hyphenation of a word can be changed from its default
by long pressing for 3 seconds and selecting 'Hyphenate'.
These overrides are stored in a per-language file, i.e:
koreader/settings/user-German.hyph.
3 years ago
hius07 4973134fb6
VirtualKeyboard: Allow hiding the keyboard with a hold on the down arrow key (#7751)
(And showing it again with a tap on an input field)
3 years ago
NiLuJe 5a468b8cf2 VirtualKeyBoard: Handle UX fallouts of VirtualKeyPopup overflow.
Don't close the popup on the first hold_release, ensuring it won't
immediately close on a *different* key if the finger hasn't moved.

If the finger *did* move, that's a quick swipe, and that's unaffected by
this tweak.
3 years ago
NiLuJe ad3bc29b1e
Events: Never stop propagating CloseWidget (#7744)
That seems like a rather terrible idea to beign with, and that that may actually have fatal consequences.

Re #7738

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
3 years ago
hius07 7419820c09
VirtualKeyboard: hold left/right arrows moves to start/end of line (#7730) 3 years ago
NiLuJe 6d53f83286
The great Input/GestureDetector/TimeVal spring cleanup (a.k.a., a saner main loop) (#7415)
* ReaderDictionary: Port delay computations to TimeVal
* ReaderHighlight: Port delay computations to TimeVal
* ReaderView: Port delay computations to TimeVal
* Android: Reset gesture detection state on APP_CMD_TERM_WINDOW.
  This prevents potentially being stuck in bogus gesture states when switching apps.
* GestureDetector:
  * Port delay computations to TimeVal
  * Fixed delay computations to handle time warps (large and negative deltas).
  * Simplified timed callback handling to invalidate timers much earlier, preventing accumulating useless timers that no longer have any chance of ever detecting a gesture.
  * Fixed state clearing to handle the actual effective slots, instead of hard-coding slot 0 & slot 1.
  * Simplified timed callback handling in general, and added support for a timerfd backend for better performance and accuracy.
  * The improved timed callback handling allows us to detect and honor (as much as possible) the three possible clock sources usable by Linux evdev events.
    The only case where synthetic timestamps are used (and that only to handle timed callbacks) is limited to non-timerfd platforms where input events use
    a clock source that is *NOT* MONOTONIC.
    AFAICT, that's pretty much... PocketBook, and that's it?
* Input:
  * Use the <linux/input.h> FFI module instead of re-declaring every constant
  * Fixed (verbose) debug logging of input events to actually translate said constants properly.
  * Completely reset gesture detection state on suspend. This should prevent bogus gesture detection on resume.
  * Refactored the waitEvent loop to make it easier to comprehend (hopefully) and much more efficient.
    Of specific note, it no longer does a crazy select spam every 100µs, instead computing and relying on sane timeouts,
    as afforded by switching the UI event/input loop to the MONOTONIC time base, and the refactored timed callbacks in GestureDetector.
* reMarkable: Stopped enforcing synthetic timestamps on input events, as it should no longer be necessary.
* TimeVal:
  * Refactored and simplified, especially as far as metamethods are concerned (based on <bsd/sys/time.h>).
  * Added a host of new methods to query the various POSIX clock sources, and made :now default to MONOTONIC.
  * Removed the debug guard in __sub, as time going backwards can be a perfectly normal occurrence.
  * New methods:
    * Clock sources: :realtime, :monotonic, :monotonic_coarse, :realtime_coarse, :boottime
    * Utility: :tonumber, :tousecs, :tomsecs, :fromnumber, :isPositive, :isZero
* UIManager:
  * Ported event loop & scheduling to TimeVal, and switched to the MONOTONIC time base.
    This ensures reliable and consistent scheduling, as time is ensured never to go backwards.
  * Added a :getTime() method, that returns a cached TimeVal:now(), updated at the top of every UI frame.
    It's used throughout the codebase to cadge a syscall in circumstances where we are guaranteed that a syscall would return a mostly identical value,
    because very few time has passed.
    The only code left that does live syscalls does it because it's actually necessary for accuracy,
    and the only code left that does that in a REALTIME time base is code that *actually* deals with calendar time (e.g., Statistics).
* DictQuickLookup: Port delay computations to TimeVal
* FootNoteWidget: Port delay computations to TimeVal
* HTMLBoxWidget: Port delay computations to TimeVal
* Notification: Port delay computations to TimeVal
* TextBoxWidget: Port delay computations to TimeVal
* AutoSuspend: Port to TimeVal
* AutoTurn:
  * Fix it so that settings are actually honored.
  * Port to TimeVal
* BackgroundRunner: Port to TimeVal
* Calibre: Port benchmarking code to TimeVal
* BookInfoManager: Removed unnecessary yield in the metadata extraction subprocess now that subprocesses get scheduled properly.

* All in all, these changes reduced the CPU cost of a single tap by a factor of ten (!), and got rid of an insane amount of weird poll/wakeup cycles that must have been hell on CPU schedulers and batteries..
3 years ago
NiLuJe bf6c0cdd6c
LuaSettings: Add a method to initialize a setting properly (#7371)
* LuaSettings/DocSettings: Updated readSetting API to allow proper initialization to default.
Use it to initialize tables, e.g., fixing corner-cases in readerFooter that could prevent settings from being saved.
(Fixes an issue reported on Gitter).
* LuaSettings/DocSettings: Add simpler API than the the flip* ones to toggle boolean settings.
* Update LuaSettings/DocSettigns usage throughout the codebase to use the dedicated boolean methods wher appropriate, and clean up some of the more mind-bending uses.
* FileChooser: Implement an extended default exclusion list (fix #2360)
* ScreenSaver: Refactor to avoid the pile of kludges this was threatening to become. Code should be easier to follow and use, and fallbacks now behave as expected (fix #4418).
3 years ago
josdion 3d8d40d797
Add Bulgarian keyboard layout (#7367) 3 years ago
Monirzadeh 6f50d67b5d
[UX] Add Persian keyboard (#7222)
Fixes #5791.
3 years ago
Beka Arabuli f665a25e70
Georgian keyboard (#7225) 3 years ago
NiLuJe 0c76c73e4f
Assorted fixes after #7118 (#7161)
* I'd failed to notice that ButtonTable *also* instantiates seven billion Buttons on each update. Unfortunately, that one is way trickier to fix properly, so, work around its behavior in Button. (This fixes multiple issues with stuff using ButtonTable, which is basically anything with a persistent set of buttons. A good and easy test-case is the dictionary popup, e.g., the Highlight button changes text, and the next/prev dic buttons change state. All that, and more, was broken ;p).

* Handle corner-cases related to VirtualKeyboard (e.g., Terminal & Text Editor), which screwed with both TouchMenu & Button heuristics because it's weird.

* Flag a the dictionary switch buttons as vsync

(They trigger a partial repaint of the dictionary content).

* Flag the ReaderSearch buttons as vsync

They very obviously trigger a partial repaint, much like SkimTo ;p.
3 years ago
poire-z 74c1813a82 GestureDetector: add Tap interval on keyboard setting
Follow up to b90f6db8: allow specifying an other
value for tap interval when the keyboard is shown
(a good value for tap interval on reader and UI
elements might be too long on the keyboard, and
prevent typing fast).
4 years ago
Marek Gibek 20a413389c
[UX] Add Polish keyboard layout (#6762) 4 years ago
NiLuJe 99045b4311
Minor util & ffi/util cleanups (#6657) 4 years ago
zwim 4349272d9c
[UX] German keyboard layout qwertz (#6385)
Add support for German keyboard. It's mainly en_keyoard.lua with changed z/Z and y/Y.
4 years ago
poire-z c1be488a11 Keyboard: better isolation of FR/ES/TR from EN base
dofile() wasn't enough to copy en_keyboard, as the references
to key popups would still be shared, and hacks to them (as
done by the FR keyboard) would be active on the EN keyboard.
Also, for the FR Keyboard:
- bring M key popup too when moving it to 2nd row.
- keep original ',' and '.' as on EN keyboard.
- add ';' instead of ',' as the added key, and let it have
  some key popup too, with keys helpful when CSS editing.
4 years ago
Mustafa Ali Mutlu 5724971466 add turkish f keyboard layout (#5795) 4 years ago
WaseemAlkurdi c8b3942bf4 [UX] Keyboard for Arabic and languages with Arabic script (#5569) 4 years ago
poire-z 7952fa2c09 [RTL UI] update widgets and apps for UI mirroring
Small tweaks all around to handle UI mirroring:
- swap existing symbols like arrows, or use alternative ones
- rotate some images, like chevrons and dogear icons
- flip some left and right swipe handling
- flip some geometry arithmetic like tap on left or right
  side of page or dict window
- use new ProgressWidget:getPercentageFromPosition() instead
  of geometry arithmetic
- BD.wrap() some concatenated string bits, like in reader
  and menu footers
- flip inverse_reading_order when UI is mirrored

More specific tweaks:
- ReaderGesture: reset some specific gestures when UI direction
  has changed (tap on top/bottom left/right corners, for
  bookmarks and FileManager "Plus menu").
- ReaderRolling: show markers on the correct side of page,
  in single or dual page mode.
- KoptOptions: swap left and right icons in Alignment toggle
- CheckMark: proper rendering in all 4 mirroring/rtl combinations.
- VirtualKeyboard: forbid any mirroring
- Move util.getMenuText into Menu.lua
4 years ago
Mihai Vasiliu 2541440bb8 [UX] Add Romanian keyboard layout (#5660)
This adds a new separate Romanian keyboard layout, with popup support.

- Functional buttons are translated.
- Pages 5&6 contain 3 groups of characters (I tried my best to group them logically):
  - On the left: traditional Romanian cyrillic pre-1850s
  - On the middle latinised forms from 1850s onwards
  - On the right modern diacritics from 1900s to today
- Pages 7&8 add only large double quotes and section/paragraph mark.
- Popups are only avalable for most common diacritics. Swipe up for circumflex, swipe down for breve.

I can really call this the most complete though-the-ages Romanian keyboard. :)
5 years ago
poire-z 397211644d Keyboard: properly handle keyboard layout height change
The japanese keyboard being taller than the others, when
switching to/from it from/to another layout:
- re-init InputDialog for proper sizing and positionning
- refresh the whole screen, to remove any trace of
  a previous taller keyboard

Also add calls to :free() here and there to free keyboard
keys' TextWidgets' XText C objects without waiting for GC.
5 years ago
poire-z 13fa6d962c Korean keyboard: unwrap InputText on layout change
The korean keyboard wraps InputText and overrides some
of its methods to process input in some specific way.
When switching to another keyboard layout, the original
methods need to be restored.
5 years ago
NiLuJe 4778d3db3b
[RFC] Switch remaining keyboard icons to glyphs (#5639)
* Switch the last few remaining icons to true glyphs
(Del/Backspace & Enter).
Also, allow a glyph to be rendered in (fake) bold, and use it for Enter.
* Update fonts
Pickup the tweaked nerdfonts for the backspace symbol
5 years ago
Frans de Jonge 15fe0fef07
[chore] Extract Cyrillic/Russian keyboard (#5610)
Follow-up to #5583.

* Add separate Cyrillic/Russian keyboard

* And remove that from English

* Update French keyboard (is easy)

* Remove yahzhert, that was just a double of QWERTY

* Update Spanish keyboard

* Reduce Japanese to 4 layers and add globe

* Reduce Korean to 4 layers

* Reduce Greek to 8 layers
5 years ago
yparitcher 5e8d1227ef [feat, UX] Pick keyboard layout from keyboard (#5583)
* Tap goes to next activated keyboard.
* Hold opens a selection popup.
5 years ago
Frans de Jonge 2855fdfdac
[feat] Support callback function in VirtualKeyPopup (#5588)
Required for <https://github.com/koreader/koreader/pull/5583>.
5 years ago
poire-z 0885e9947d Keyboard: avoid additional key stroke on hold release (#5573) 5 years ago
Frans de Jonge f7861bc1eb
[feat] Add haptic feedback (#5380)
References <https://github.com/koreader/koreader/issues/5374>.
5 years ago
yparitcher 31b9f78384 [UX] Add Hebrew keyboard (#5414) 5 years ago
Frans de Jonge 17e437dbd0
[UX] Allow keyboard layout selection (#5318)
Fixes <https://github.com/koreader/koreader/issues/3998>.

This isn't quite what I want but I've been letting this slip for
too long due to fancier keyboard interaction concepts.
5 years ago
Robert c57beada27 [chore] Remove Polish keyboard (#5223) 5 years ago
limerainne 53b6e3d018 [i18n] Add Korean keyboard (2-beolsik) (#5053) 5 years ago
Frans de Jonge 2968f558eb
[fix, UX] Ignore first hold release when keyboard opened with hold (#5011)
Fixes #4902.
5 years ago
NiLuJe 888d3591b2
Give more control over CRe margins (#4945)
Without having to resort to weird custom defaults.

* Split the current margins setting in three:
  * Horizontal margins (because you generally want those two to be balanced).
  * Top margin & Bottom margin (because you may want to tweak those separately to deal with quirky status bar/final line shenanigans).

* Also, add a "Reclaim bar height from bottom margin" toggle to the status bar menu, to optionally make sure the status bar won't eat into the bottom margin.

* Includes a free fix to diacritics popup refresh handling in the keyboard ;).
5 years ago
Frans de Jonge 021f1d9107
[fix] VirtualKeyboard: always fall back to en (like it used to) (#4900)
Fixes #4899.
5 years ago
Frans de Jonge 4ba826ca3c
[fix] VirtualKeyPopup close refresh (#4897)
See https://github.com/koreader/koreader/pull/4891#issuecomment-481866246
5 years ago
Frans de Jonge 3f59dee721
[UX] VirtualKeyPopup: variable size (#4892)
This makes the code a lot more complex, but it looks much better.
5 years ago
Frans de Jonge fd50dc34a6
[UX] VirtualKeyPopup: close on hold release (#4891)
As suggested by @poire-z.
5 years ago
Frans de Jonge 80953b5c4c
[UX] Keyboard: add @ and A diacritics (#4889)
Also rename std to en_keyboard.
5 years ago
Frans de Jonge 69e3830bc1
[UX] VirtualKeyPopup: respond to hold & pan release (#4887)
As suggested by @poire-z in https://github.com/koreader/koreader/pull/4886#discussion_r273569802

This is actually much better than before.

It subtly changes the behavior of every key this way, but I don't think that's a bad thing.
5 years ago