Lua Module: Long key press

Started by garry23, March 09, 2016, 10:38:05 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

garry23

David

I've tried to get an event.keypress to 'detect' a log key press, but have failed.

Is there any chance you could 'hard wire' such a feature into the Lua module.

To be clear, so the Lua event.keypress can flag up the difference between a simple key press and a long key press.

This will greatly increase the functionality of script, especially on cameras with limited buttons, eg the EOS-M

Cheers

Garry

dmilligan

You can only tell a long keypress on buttons that have an 'unpress' event. Just use dryos.ms_clock to measure the time between press and unpress.

For the EOSM, I've pretty much abandoned trying to use buttons altogether, and just use the touchscreen. See the lua_touch branch, the touch keyboard is quite functional. I'd eventually like to make the ML menu completely touch based.

garry23

David

Understood: I'll look into using the touchscreen UI to control things.

Cheers

Garry

garry23

David

Sorry, I forgot to add, when I looked at the touchscreen Lua UI before, it wasn't clear to me how to register what part of the screen was touched.

Can you give me a gentle nudge in the right direction.

Cheers

Garry

dmilligan

look at touch.lua, lib/keys.lua and lib/keyboard.lua in the lua_touch branch, or look at the comments in lua_touch.c

garry23

David

Thanks: but I don't feel confident to compile my own from the branch source :(

I guess I'll have to wait.

Cheers

Garry

Walter Schulz

Plunge in, sharks are actually friendly. (Even may not be sharks but some kind of dolphins).
I built a Hackingtosh machine following some thread here, used dfort's easy to follow instructions to build a development enviroment and it is just fun to run "make" and have stuff at hand not yet available in main repository. Most of the time I have no idea what I'm doing.
http://www.magiclantern.fm/forum/index.php?topic=16012.5

garry23

Walter

About a year ago I did successfully compile via the cloud. But I think this isn't possible anymore ?

Also I'm a Windows guy  :)

Cheers

Garry

Walter Schulz

As I said: I built a Hackintosh and you may call me a Windows (and DOS/NetWare) guy coming from DOS.3.x/Win 3.0/Netware 3.11. Had no affiliation to OS X before.

dmilligan

Well you can just about as easily run your own Linux vm, that's all "compile in the cloud" really was (the vm was just hosted in the cloud).

dfort

Cygwin is also easy to use on Windows.

http://magiclantern.fm/forum/index.php?topic=15894.0

I've also been looking at lua-touch. Pretty cool.

garry23

Thanks everyone. I will look at setting up a compile environment this weekend.

Cheers

Garry

garry23

I have tried and got so far following the instructions. But I'm not cleaver enough to fight errors about 'bash' :-)

$ cd && wget https://launchpad.net/gcc-arm-embedded/4.8/4.8-2013-q4-major/+download/gcc-arm-none-eabi-4_8-2013q4-20131204-win32.zip && mkdir gcc-arm-none-eabi-4_8-2013q4 && unzip -n gcc-arm-none-eabi-4_8-2013q4-20131204-win32.zip -d gcc-arm-none-eabi-4_8-2013q4 && rm gcc-arm-none-eabi-4_8-2013q4-20131204-win32.zip
-bash: wget: command not found


Walter Schulz

Do you have wget installed? Try
sudo apt-get install wget

garry23

I get this if I type that cmd line into the Cygwin64 Terminal

$ sudo apt-get install wget
-bash: sudo: command not found

Walter Schulz


garry23

Thank you :)

I get the following now: should I worry about the error at the end?

$ cd && wget https://launchpad.net/gcc-arm-embedde                      d/4.8/4.8-2013-q4-major/+download/gcc-arm-none-eab                      i-4_8-2013q4-20131204-win32.zip && mkdir gcc-arm-n                      one-eabi-4_8-2013q4 && unzip -n gcc-arm-none-eabi-                      4_8-2013q4-20131204-win32.zip -d gcc-arm-none-eabi                      -4_8-2013q4 && rm gcc-arm-none-eabi-4_8-2013q4-201                      31204-win32.zip
--2016-03-10 17:58:40--  https://launchpad.net/gcc                      -arm-embedded/4.8/4.8-2013-q4-major/+download/gcc-                      arm-none-eabi-4_8-2013q4-20131204-win32.zip
Resolving launchpad.net (launchpad.net)... 91.189.                      89.222, 91.189.89.223
Connecting to launchpad.net (launchpad.net)|91.189                      .89.222|:443... connected.
HTTP request sent, awaiting response... 302 Moved                       Temporarily
Location: https://launchpadlibrarian.net/160488289                      /gcc-arm-none-eabi-4_8-2013q4-20131204-win32.zip [                      following]
--2016-03-10 17:58:42--  https://launchpadlibraria                      n.net/160488289/gcc-arm-none-eabi-4_8-2013q4-20131                      204-win32.zip
Resolving launchpadlibrarian.net (launchpadlibrari                      an.net)... 91.189.89.228, 91.189.89.229
Connecting to launchpadlibrarian.net (launchpadlib                      rarian.net)|91.189.89.228|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 104379892 (100M) [application/zip]
Saving to: 'gcc-arm-none-eabi-4_8-2013q4-20131204-                      win32.zip'

Segmentation fault (core dumped)

garry23

Walter

Forget it  :)

I keep getting errors beyond me.

I play in the background.

Thanks for your help.

Cheers

Garry

Walter Schulz

Cygwin and I never got friends, though. Fell in love with virtual machines ...

garry23

The up side of the ML site is you get to e-speak with some great people. The down side is that idiots like me simply can not keep up or understand some of the conversation.

It truly would be great if some kind sole could refresh the 'compile your own' instructions, truly for total novices like me.

As I said, I value your attempts at helping me  :-[

Walter Schulz

As I said: I made a Hackintosh (crude without sound and after some failure) up and running and just followed dfort's tutorial. If you have enough RAM and if you are able to cope with some hardware limitations you may just be fine with a virtual machine running OS X.
Did you give dmilligan's hint about compiling in the cloud a chance?

garry23

Walter

I have an account on Codio so I have just retried it, following these instructions: http://magiclantern.fm/forum/index.php?topic=14725.0

For the life of me I can't find Install Software under tools - "When the project opens, goto Tools > Install Software and install 'zip'"

Any ideas :)

Cheers

Garry

Walter Schulz

I tried to explain I have a development machine running and therefore my experience with codio (= lack of) is not helping.

garry23

Hopefully someone else 'watching' can add some value, i.e. Using Codio for ML compiling.

dfort

I was able to do my first successful ML build with Codio. It took me a while to figure out how to set up my own ML development environment  computers but once I did I posted tutorials for others who found themselves in the same situation I was in.

As for the problem with wget, if you followed my Cygwin tutorial you should have installed wget but no worries, simply re-run the Cygwin installer and pick wget.

Want a shortcut to set up Cygwin? Check out the "Quick start for the terminally impatient" in my tutorial.

By the way the 32-bit version is the preferred version for ML even if you have a 64-bit system.