spa46
Posts: 3
Joined: Sat Apr 09, 2016 3:48 am

Simple Python code to C

Sat Apr 09, 2016 4:11 am

I am currently converting python code to C. (I am new in python).
There is a open source code receving event for keypad.
Could you please help me how to express below code in C?
Thanks.

events = (uinput.BTN_A, uinput.BTN_B, uinput.BTN_C, uinput.BTN_X, uinput.ABS_X + (0, 255, 0, 0), uinput.ABS_Y + (0, 255, 0, 0))
device = uinput.Device(events)

device.emit(uinput.ABS_X, 128, syn=False)
device.emit(uinput.ABS_Y, 128)

device.emit(uinput.ABS_Y, 0) # Zero Y

itsagoodquestion
Posts: 47
Joined: Sat Mar 05, 2016 10:30 pm

Re: Simple Python code to C

Sat Apr 09, 2016 7:19 pm

edit--- entire C source is available if you do basic internet search...

https://github.com/tuomasjjrasanen/python-uinput

spa46
Posts: 3
Joined: Sat Apr 09, 2016 3:48 am

Re: Simple Python code to C

Mon Apr 11, 2016 7:00 am

It is great thank you so much.

Return to “C/C++”