CHDK Wiki
(update hostlua with notepad++ version 3.0)
Tag: sourceedit
(screenshot added)
Tag: sourceedit
(3 intermediate revisions by the same user not shown)
Line 1: Line 1:
The CHDK hostlua environment allows the following commands directly from the editor:
+
'''Project CHDK hostlua for Windows with the editor Notepad++'''
   
  +
* Project version 3.0
  +
* CHDK version: 1.4, with adjustments for 1.3 Scripts
  +
* Lizence: GPL2 (C)2012-2015 forum.chdk-treff.de
  +
* Authors: rudi, msl
  +
* Sources: https://subversion.assembla.com/svn/rudi_space/hostlua_npp
 
* execute [http://chdk.wikia.com/wiki/Lua CHDK Lua scripts] on a Windows PC
 
* execute [http://chdk.wikia.com/wiki/Lua CHDK Lua scripts] on a Windows PC
 
* execute CHDK Lua scripts on the camera
 
* execute CHDK Lua scripts on the camera
Line 53: Line 58:
 
* F: portable Notepad++: "...\Notepad++Portable\Data\Config\plugins\config\"
 
* F: portable Notepad++: "...\Notepad++Portable\Data\Config\plugins\config\"
   
===NppExec is already in use:===
+
===D NppExec is already in use:===
   
* Finish Notepad++
+
* Close Notepad++
* Add/Update the content of "hostlua\plugin_NppExec\config\npes_saved.txt" in the file npes_saved.txt.
+
* Add/Update the content of "hostlua\plugin_NppExec\config\npes_saved.txt" in the file npes_saved.txt in ...
* This file is in:
+
* select E: or F:
** Installed Notepad++: "C:\Users\<username>\AppData\Roaming\Notepad++\plugins\config"
+
* E: installed Notepad++: "C:\Users\<Benutzername>\AppData\Roaming\Notepad++\plugins\config"
** portable Notepad++: "...\Notepad++Portable\Data\settings\plugins\config"
+
* F: portable Notepad++: "...\Notepad++Portable\Data\Config\plugins\config\"
 
* Check the setting in Notepad++ menu "Pugins => NppExec => Console Output...{ANSI/ANSI}"
 
* Check the setting in Notepad++ menu "Pugins => NppExec => Console Output...{ANSI/ANSI}"
 
* Recommendation: activate the setting in Notepad++ menu "Plugins => NppExec => Save all files on Execute"
 
* Recommendation: activate the setting in Notepad++ menu "Plugins => NppExec => Save all files on Execute"
Line 78: Line 83:
 
> Execute Lua scripts in the CHDK script emulator.
 
> Execute Lua scripts in the CHDK script emulator.
   
  +
* '''CHDK LUA local keypad'''
> Bit operations do not work (known bug).
 
  +
  +
[[File:Draw_test_keypad.png]]
  +
  +
> Execute Lua scripts in the CHDK script emulator with virtual keyboard and display.
  +
> GUI keypad usage:
  +
shortcut | description
  +
---------------------------------
  +
[CTRL]+[UP] | button UP
  +
[CTRL]+[DOWN] | button DOWN
  +
[CTRL]+[RIGHT] | button RIGHT
  +
[CTRL]+[LEFT] | button LEFT
  +
[CTRL]+[ENTER] | button FUNC/SET
  +
[CTRL]+[h] | button SHOOT HALF
  +
[CTRL]+[s] | button SHOOT FULL
  +
[CTRL]+[v] | button VIDEO
  +
[CTRL]+[+] | button ZOOM IN
  +
[CTRL]+[-] | button ZOOM OUT
  +
[CTRL]+[m] | button MENU
  +
[CTRL]+[d] | button DISP.
  +
[CTRL]+[1] | button RC1
  +
[CTRL]+[2] | button RC2
  +
[CTRL]+[3] | button RC3
  +
[CTRL]+[4] | button RC4
  +
[F2] | toggle LCD width
  +
[F3] | LCD width 360 px
  +
[F4] | LCD width 480 px
  +
[ESC] | EXIT - break runnig script and close keypad
  +
  +
context menu:
  +
"LCD Width" ------+-- "LCD 360 px"
  +
+-- "LCD 480 px"
  +
  +
"Code Page" ------+-- "1250"
  +
+-- "1251"
  +
+-- "1252"
  +
+-- "1253"
  +
+-- "1254"
  +
+-- "1257"
  +
  +
"GUI Close Type" -+-- "On Exit Script"
  +
+-- "After 10 Seconds"
  +
+-- "On Lost Focus"
  +
"Exit"
   
 
* '''CHDK LUA remote'''
 
* '''CHDK LUA remote'''

Revision as of 11:42, 9 June 2015

Project CHDK hostlua for Windows with the editor Notepad++

Software of other developers included in the package

Requirements:

Installation:

  • Unzip the folder "hostlua" from hostlua.zip to any destination.
  • Configuration of Notepad++ console: select A or B

A Local Notepad++ Portable (directory: hostlua\Notepad++Portable)

New installation Notepad++ Portable

Configuration

  • Run file "local_config.cmd in subfolder "hostlua\plugin_NppExec"

Start of local Noptepad++ Portable

  • via the "Start Notepad++" in the main folder hostlua\

B with installed Notepad++ or Notepad++ Portable (not unpacked as point A)

  • Run file "create_config.cmd" in subfolder "hostlua\plugin_NppExec".
  • select C: or D:

C First use of NppExec:

  • Installation of the Plugin via Noteoad ++ menu "Adjustments > Import > import Plugin(s)..."select "hostlua\plugin_NppExec\NppExec.dll"
  • Close Notepad++
  • Copy all files from subdir "hostlua\plugin_NppExec\config" to:
  • select E: or F:
  • E: installed Notepad++: "C:\Users\<Benutzername>\AppData\Roaming\Notepad++\plugins\config"
  • F: portable Notepad++: "...\Notepad++Portable\Data\Config\plugins\config\"

D NppExec is already in use:

  • Close Notepad++
  • Add/Update the content of "hostlua\plugin_NppExec\config\npes_saved.txt" in the file npes_saved.txt in ...
  • select E: or F:
  • E: installed Notepad++: "C:\Users\<Benutzername>\AppData\Roaming\Notepad++\plugins\config"
  • F: portable Notepad++: "...\Notepad++Portable\Data\Config\plugins\config\"
  • Check the setting in Notepad++ menu "Pugins => NppExec => Console Output...{ANSI/ANSI}"
  • Recommendation: activate the setting in Notepad++ menu "Plugins => NppExec => Save all files on Execute"

Operations

General

Lua files are always subjected to a simple syntax examination. File locations:

  • CHDK files: "hostlua\A\CHDK\..."
  • Lua libraries: "hostlua\A\CHDK\LUALIB\"
  • Lua scripts: accepted from all folders, copy to the camera "A\CHDK\SCRIPS\".
  • PTP command files have the extension ".ptp", accepted from all folders.

Available commands in Notepad++ console:

  • CHDK LUA local

> Execute Lua scripts in the CHDK script emulator.

  • CHDK LUA local keypad

Draw test keypad

> Execute Lua scripts in the CHDK script emulator with virtual keyboard and display. > GUI keypad usage:

         shortcut    | description
     ---------------------------------
     [CTRL]+[UP]     | button UP
     [CTRL]+[DOWN]   | button DOWN
     [CTRL]+[RIGHT]  | button RIGHT
     [CTRL]+[LEFT]   | button LEFT
     [CTRL]+[ENTER]  | button FUNC/SET
     [CTRL]+[h]      | button SHOOT HALF
     [CTRL]+[s]      | button SHOOT FULL
     [CTRL]+[v]      | button VIDEO
     [CTRL]+[+]      | button ZOOM IN
     [CTRL]+[-]      | button ZOOM OUT
     [CTRL]+[m]      | button MENU
     [CTRL]+[d]      | button DISP.
     [CTRL]+[1]      | button RC1
     [CTRL]+[2]      | button RC2
     [CTRL]+[3]      | button RC3
     [CTRL]+[4]      | button RC4
     [F2]            | toggle LCD width
     [F3]            | LCD width 360 px
     [F4]            | LCD width 480 px
     [ESC]           | EXIT - break runnig script and close keypad
     context menu:
     "LCD Width" ------+-- "LCD 360 px"
                       +-- "LCD 480 px"
     "Code Page" ------+-- "1250"
                       +-- "1251"
                       +-- "1252"
                       +-- "1253"
                       +-- "1254"
                       +-- "1257"
     "GUI Close Type" -+-- "On Exit Script"
                       +-- "After 10 Seconds"
                       +-- "On Lost Focus"
     "Exit"
  • CHDK LUA remote

> Transferring files to the camera and run Lua scripts on the camera.

> The Lua command set_record() can be used despite PTP connection.

  • CHDK LUA remote output

> The same as "CHDK LUA remote".

> In addition, the outputs of the script console output to the Notepad++ console at script end.

> Scripts will run a bit slower compared to "LUA CHDK remote".

  • CHDK PTP

> Processing of PTP commands with chdkptp. Command list under "hostlua\bin\chdkptp_USAGE.TXT" or usage.txt.

Usage

  • Open a CHDK Lua file in Notepad++.
  • Start console command in Notepad++ menu "Macro"
  • Repeat last console command: CTRL+F6

Links