various fixes on Device:hasKeyboard check

pull/313/head
chrox 11 years ago
parent c829b01d67
commit cd2ee14b91

@ -94,13 +94,14 @@ function ReaderBookmark:onShowBookmark()
}
-- buid up menu widget method as closure
local doc = self.ui.document
local view = self.view
local sendEv = function(ev)
self.ui:handleEvent(ev)
end
function bm_menu:onMenuChoice(item)
if doc.info.has_pages then
sendEv(Event:new("PageUpdate", item.page))
elseif self.view.view_mode == "page" then
elseif view.view_mode == "page" then
sendEv(Event:new("PageUpdate", doc:getPageFromXPointer(item.page)))
else
sendEv(Event:new("PosUpdate", doc:getPosFromXPointer(item.page)))

@ -9,7 +9,7 @@ ReaderFont = InputContainer:new{
}
function ReaderFont:init()
if not Device:hasNoKeyboard() then
if Device:hasKeyboard() then
-- add shortcut for keyboard
self.key_events = {
ShowFontMenu = { {"F"}, doc = _("show font menu") },

@ -4,7 +4,7 @@ ReaderToc = InputContainer:new{
}
function ReaderToc:init()
if not Device:hasNoKeyboard() then
if Device:hasKeyboard() then
self.key_events = {
ShowToc = {
{ "T" },

@ -13,11 +13,12 @@ InfoMessage = InputContainer:new{
function InfoMessage:init()
if Device:hasKeyboard() then
key_events = {
self.key_events = {
AnyKeyPressed = { { Input.group.Any },
seqtext = "any key", doc = _("close dialog") }
}
else
end
if Device:isTouchDevice() then
self.ges_events.TapClose = {
GestureRange:new{
ges = "tap",

@ -11,7 +11,7 @@ Notification = InputContainer:new{
function Notification:init()
if Device:hasKeyboard() then
key_events = {
self.key_events = {
AnyKeyPressed = { { Input.group.Any }, seqtext = "any key", doc = "close dialog" }
}
end

Loading…
Cancel
Save