-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Introduce Device:useDPadAsActionKeys() #11900
Introduce Device:useDPadAsActionKeys() #11900
Conversation
All uses of Device:hasFiveWay() that aren't explicitly for Kindle are changed to Device:hasDPad() and Device:useDPadAsActionKeys(). See koreader#11887.
This better reflects the actual feature it's using.
Technically speaking, only K4 has a ScreenKB key, so it might be wise to use something else to dub isKindle with. |
useKindleKeys? |
I think we could use That way |
You are also ignoring #11864 which fixes the fact that content selection does not actually work atm. |
@Commodore64user implemented as per your suggestion |
self.key_events.SelectNextPageLink = { { "Shift", "LPgFwd" }, event = "SelectNextPageLink" } | ||
self.key_events.SelectPrevPageLink = { { "Shift", "LPgBack" }, event = "SelectPrevPageLink" } | ||
else | ||
self.key_events.AddCurrentLocationToStack = { { "ScreenKB", "Down" } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could you change this to ScreenKB
and Press
(instead of Down
) there is something I want to try and if successful would go on KB+Down. Also, any idea why this doesn't show a notification when one uses it? normally at the top of the screen a little box appears saying, "added to stack or whatever" (yes all notifications under Screen menu are ON).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like notification true or false is passed as an argument. DIspatcher sets arg=true.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ve already tried that and still won’t show it… not sure why
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm yes, the true comes through if you add args=true
but it doesn't seem to show the notification. You say it works from Dispatcher?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the defaults
Being SOURCE_OTHER
, which is described as all other sources (e.g. keyboard)
, which is indeed masked out unless you explicitly request notifications from all sources.
TL;DR: behaving as expected ;).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, so how do we set a source and/or make it show the notification?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We... don't because it's behaving as expected and keyboard shortcuts shouldn't display notifications unless the user asks for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but this is 'different'...? I need the notification to be shown so it provides feedback on NT kindles, otherwise it would appear as if nothing was happening.
Essentially it should work same as if it was coming from dispatcher.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then you need a custom event that either wraps the current one between Notification:setNotifySource(Notification.SOURCE_ALWAYS_SHOW)
<-> Notification:resetNotifySource()
(double-check that for obvious typos) or reimplement the current one except that it passes Notification.SOURCE_ALWAYS_SHOW
as the second arg to Notify
.
if Device:hasScreenKB() or Device:hasSymKey() then | ||
self.key_events.GotoSelectedPageLink = { { "Press" }, event = "GotoSelectedPageLink" } | ||
if Device:hasKeyboard() then | ||
self.key_events.AddCurrentLocationToStack = { { "Shift", "Down" } } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here Shift
+ Press
…hen activated via keypress (#11925) As seen here #11900 (comment).
hasFiveWay
behavior is changed tohasDPad and useDPadAsActionKeys
. For now they remain Kindle-specific in practice, unless one setsuseDPadAsActionKeys = yes
in a user patch.hasFiveWay
itself is further disambiguated intohasScreenKB
andhasSymKey
, as per the actual property being used, rather than something that tends to correlate with it. (It needn't be Kindle-specific per se, but non-Kindle devices have equivalent shortcuts with for exampleShift
.)Running the emulator with
DISABLE_TOUCH=1
will sethasSymKey = yes
, which can be tested with right shift.Closes #11887.
This change is