input: fix loading of fbink_input library (#12560)

The library is versioned.
This commit is contained in:
Benoit Pierre
2024-09-26 23:07:15 +02:00
committed by GitHub
parent a1edbbf0c4
commit d98fe14ba8
3 changed files with 6 additions and 4 deletions

View File

@@ -476,8 +476,9 @@ end
function Kindle:openInputDevices()
-- Auto-detect input devices (via FBInk's fbink_input_scan)
local ok, FBInkInput = pcall(ffi.loadlib, "fbink_input")
local ok, FBInkInput = pcall(ffi.loadlib, "fbink_input", 1)
if not ok then
print("fbink_input not loaded:", FBInkInput)
-- NOP fallback for the testsuite...
FBInkInput = { fbink_input_scan = function() end }
end

View File

@@ -862,8 +862,9 @@ function Kobo:init()
self:initEventAdjustHooks()
-- Auto-detect input devices (via FBInk's fbink_input_scan)
local ok, FBInkInput = pcall(ffi.loadlib, "fbink_input")
local ok, FBInkInput = pcall(ffi.loadlib, "fbink_input", 1)
if not ok then
print("fbink_input not loaded:", FBInkInput)
-- NOP fallback for the testsuite...
FBInkInput = { fbink_input_scan = NOP }
end

View File

@@ -291,7 +291,7 @@ end)
local function findKeyboards()
local keyboards = {}
local FBInkInput = ffi.loadlib("fbink_input")
local FBInkInput = ffi.loadlib("fbink_input", 1)
local dev_count = ffi.new("size_t[1]")
local devices = FBInkInput.fbink_input_scan(C.INPUT_KEYBOARD, 0, 0, dev_count)
if devices ~= nil then
@@ -312,7 +312,7 @@ end
local function checkKeyboard(path)
local keyboard
local FBInkInput = ffi.loadlib("fbink_input")
local FBInkInput = ffi.loadlib("fbink_input", 1)
local dev = FBInkInput.fbink_input_check(path, C.INPUT_KEYBOARD, 0, 0)
if dev ~= nil then
if dev.matched then