View Single Post
Old 06-24-2013, 06:21 PM   #399
Cykotitan
Enthusiast
Cykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animalsCykotitan is kind to children and small, furry animals
 
Posts: 44
Karma: 6550
Join Date: May 2013
Location: Bosnia & Herzegovina
Device: Kindle Paperwhite 1 WiFi
I was not missing an end, I've only pasted the partial function because it also had handling for keys (altough those are unused on KT/Paperwhite)

This was my implementation for autodetection of screen orientation, however produces wrong results if you leave the book mode in Landscape even while the dispay is not set to Landscape orientation:
Code:
f = io.popen('/usr/bin/lipc-get-prop com.lab126.winmgr orientationLock', 'r')
orient = f:read('*l')
f:close()


function handleInput(channel, itype, code, value)
	if itype == 3 and channel == 0 then
		if code == 57 then
			clickevent = value + 1
			SendPointerEvent(orient == 'U' and x or math.min(client_width, 1023)-y, orient == 'U' and y or x, 0)
		elseif code == 53 then
			x = value
		elseif code == 54 then
			y = value
			if clickevent == 1 then
				SendPointerEvent(orient == 'U' and x or math.min(client_width, 1023)-y, orient == 'U' and y or x, 1)
			end
		end

Last edited by Cykotitan; 06-24-2013 at 10:44 PM.
Cykotitan is offline   Reply With Quote