Compare commits

...

83 commits

Author SHA1 Message Date
168a4dd30b
[fix]: updated version number and copyright
Some checks failed
Create release on tag push / Create mod release (push) Failing after 28s
2024-05-03 14:33:14 +02:00
bb0f4608bf
[docs]: updated for 5.0 and dropped legacy support 2024-05-03 14:19:57 +02:00
35120ad6b8
[fix] fix for new file naming convention
Some checks failed
Create release on tag push / Create mod release (push) Failing after 52s
Also drops legacy support.

fixes #42
2024-05-03 14:05:46 +02:00
a865d1b356
chore: get rid of auto pull request workflow 2024-02-18 23:22:28 +01:00
211812427b
chore: forgejo workflows 2024-02-18 23:19:14 +01:00
alterNERDtive
75e8388ba1
Merge pull request #35 from alterNERDtive/feature/auto-pull-request
Some checks failed
Pull Request on Branch Push / Open pull request (push) Failing after 17s
2022-07-13 22:20:08 +02:00
8b189fb658
workflows: open pr on branch push
Some checks failed
Pull Request on Branch Push / Open pull request (push) Failing after 27s
2022-07-13 22:18:54 +02:00
4cbff59b33 fixed gh-pages workflow 2022-07-11 12:10:35 +02:00
5dfd9f18b4 Merge branch 'release' into develop 2022-07-04 01:34:04 +02:00
2ff49dd98a added ko-fi / sponsors 2022-07-04 01:33:53 +02:00
bbd7f443d3 dependabot 2022-06-01 09:03:21 +02:00
96bea9a127 auto-deploy gh-pages on release 2022-06-01 09:03:15 +02:00
495320c420 4.2.2! 2022-05-31 19:03:54 +02:00
bdf3c58241 docs: clarified that the default layout will work for most keys out of the box
fixes #32
2022-05-30 23:55:41 +02:00
4fb8cc0bcc one more stylecop concession 2022-05-30 23:52:44 +02:00
e845a32cd8 first naïve version of github actions for automated releases 2022-05-30 20:46:08 +02:00
57fdc0a2b7 fixed setting version variable 2022-05-29 23:41:13 +02:00
31894129c7 stylecop has joined the server 2022-05-29 23:32:31 +02:00
514f70ddb2 docs: now mentions the reports profile in the “Using Binds in Commands” section 2022-05-29 10:38:35 +02:00
27ba1a1c96 updated CHANGELOG
because I’m a dum dum and forgot
2022-01-12 16:11:03 +01:00
175d04c129 added info about generally not having to invoke the plugin manually to invalid context error message 2022-01-12 16:08:05 +01:00
80c23b3fb5 added specific error message for invoking without context
fixes #30
2022-01-12 16:07:34 +01:00
ef25bcd7bf Added support for Odyssey’s new StartPreset.4.start file
fixes #29
2021-12-24 17:50:34 +01:00
c83848c0e3 README: typo fixed 2021-10-11 22:08:40 +02:00
4412c1e59e README: typo fixed 2021-09-08 08:41:22 +02:00
8f8eb81fbd Merge branch 'develop' into release 2021-08-13 22:00:22 +02:00
61cd2d14fd 4.2! 2021-08-13 21:43:24 +02:00
b177fa4e1c nullable preset in DetectBindsFile() doesn’t make sense 2021-07-18 19:57:25 +02:00
856b95974c now correctly loads presets with regex special characters
fixes #28
2021-07-18 19:56:36 +02:00
b1455beddc no longer shipping old ReadMe.txt with plugin releases 2021-07-04 21:12:22 +02:00
11e4ac1575 incremented version number, because I’m a buffoon 2021-07-04 21:08:05 +02:00
83460ac9b8 docs: added link to CHANGELOG on Github 2021-07-04 20:59:36 +02:00
65534330d9 added error message if multiple presets are used
fixes #26
2021-07-04 20:59:18 +02:00
69f3a43590 docs: clarification on starting Elite first time after VA 2021-06-14 12:40:57 +02:00
f46f40abb1 docs: added actual usage instructions
fixes #24
2021-06-14 11:57:05 +02:00
9d2c5355d8 sorted out the utf-8 crap … 2021-06-14 11:46:57 +02:00
3a8d8ff620 docs: now with docs™!
also fixes #21
2021-06-14 11:32:14 +02:00
58bfdd65f1 .editorconfig: default to utf-8 2021-06-14 11:22:45 +02:00
09767d493d added diagnostics context and profile
Should help with troubleshooting.
2021-06-14 09:38:14 +02:00
3fc7e73fe8 Merge branch 'develop' into release 2021-05-23 20:22:39 +02:00
8cbf4874d7 updated .editorconfig 2021-05-23 20:22:05 +02:00
b0edff39de 4.1! 2021-05-22 18:42:19 +02:00
0652fc84ab now correctly prioritizing binds files
4.0 > 3.0 > plain
2021-05-22 18:40:50 +02:00
b99c857ccc updated preset detection for Odyssey
For now will only work with the first line; which means that Odyssey users will have to use the same preset for everything.

fixes #15
2021-05-22 18:16:28 +02:00
df5366ec4d README: updated instructions for changing Horizons binds 2021-05-22 18:09:14 +02:00
ed8ba6244c README: updated with prerequisites
You need to load the game at least once, you need to have changed at least a single bind.

fixes #19
2021-05-22 18:02:00 +02:00
d431e899bd added ~bindsFile optional parameter to loadbinds context
fixes #18
2021-05-22 17:55:34 +02:00
dadb6c8f2e Merge branch 'develop' into release 2021-05-19 12:33:24 +02:00
e63ff1bbab 4.0! 2021-05-19 12:32:01 +02:00
4cf8788049 removed deprecated empty / binds file contexts 2021-05-19 12:25:20 +02:00
bd3c5ec96f pretty printerino 2021-05-19 12:20:59 +02:00
c8b76472bb Odyssey compatibility
fixes #14
2021-05-19 12:13:14 +02:00
0736d29682 Odyssey support, quick & dirty
Just takes the last changed file of `<preset>.binds`, `<preset>.3.0.binds` or `<preset>.4.0.binds`.
2021-05-19 10:10:33 +02:00
2bb3bd947f README: added pointer to the release page.
fixes #11
2021-02-22 21:35:50 +01:00
b4059992ca README: added pointer to the release page.
fixes #11
2021-02-22 21:35:10 +01:00
47a9fd20e6 fixed version number 2021-01-30 14:36:08 +01:00
399db2b53a CHANGELOG: typo 2021-01-29 15:25:03 +01:00
4791bc3e26 3.1! 2021-01-29 15:16:52 +01:00
f25f6cd1e2 README: new Discord invite link 2021-01-28 17:26:34 +01:00
fa1709c782 now sets some version information
fixes #8
2021-01-06 22:30:57 +01:00
1fb2a491f4 updated CHANGELOG 2020-11-17 10:29:14 +01:00
4310a48aad now watching current layout’s map file for changes
fixes #4
2020-11-17 10:27:33 +01:00
225456a993 teensy tiny CHANGELOG typo 2020-11-15 00:36:02 +01:00
42df5c990c make loadbinds context a force reset of everything
fixes #5
2020-11-14 17:41:43 +01:00
620bc2b83f 3.0! 2020-11-12 21:07:41 +01:00
ffebfe5923 added en-gb key map courtesy of A.Cyprus 2020-11-09 23:10:49 +01:00
663a91996b GPLed it
Original plugin was PD; it’s basically a different piece of software at this point, and I’m a fan of copyleft.

Obviously doesn’t conflict with the original work’s license.
2020-11-09 22:58:15 +01:00
bfb0c5bed1 typos 2020-11-09 22:44:04 +01:00
1222cce7fd fixed missing exception handling for the variable changed handler 2020-11-09 16:59:23 +01:00
02d0e40e57 addded issue numbers to CHANGELOG 2020-11-09 12:30:56 +01:00
2656979d87 added VA profile to generate reports 2020-11-09 12:28:49 +01:00
bf19c77deb updated docs 2020-11-09 12:25:55 +01:00
1196c8e618 added “missingbinds” plugin context
Also had to refactor the actual bindings reading part to accomodate; more modular now, not mangled with mapping to key codes anymore.

fixes #2
2020-11-09 10:20:23 +01:00
976aa508c7 refactored with Properties, makes resetting stuff way simpler 2020-11-09 09:27:32 +01:00
60ffc81683 added bit about auto-loading to deprecation warning 2020-11-09 08:35:27 +01:00
20c12007bc now automatically reading bindings on VA start and change of bindED.layout# 2020-11-08 21:12:00 +01:00
78124a42e3 auto-detect bindings files changes!
fixes #3
2020-11-08 20:43:23 +01:00
af0914b9e1 code cleanup, massive refactoring, added listbinds plugin context
fixes #1
2020-11-08 14:58:31 +01:00
5a502b155d awful vs text file format change … 2020-11-08 12:41:36 +01:00
3b918e8972 removed old, naive way of loading the last modified binds file by default
(or linking them to the plugin directory …)
2020-11-08 12:41:09 +01:00
998b48d093 added CHANGELOG 2020-10-24 14:49:24 +02:00
2679df9437 fixed error message for empty map file 2020-09-25 02:58:30 +02:00
9da35ba6d9 derp, VS managed to check in the .zip file 2020-09-23 19:56:54 +02:00
31 changed files with 2689 additions and 977 deletions

View file

@ -1,7 +1,14 @@
# All files
[*]
[*]
guidelines = 80
end_of_line = lf
insert_final_newline = true
charset = utf-8-bom
# C# or VB files
[*.{cs,vb}]
[*.cs]
guidelines = 80, 120
# IDE0021: Use block body for constructors
csharp_style_expression_bodied_constructors = when_on_single_line
# IDE0024: Use block body for operators
csharp_style_expression_bodied_operators = when_on_single_line

View file

@ -0,0 +1,33 @@
name: Create release on tag push
on:
push:
tags:
- 'release/*'
jobs:
build:
name: Create mod release
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Get release body
run: |
echo "release_body=$(cat CHANGELOG.md)" >> "$GITHUB_ENV"
- name: Setup Go
uses: actions/setup-go@v4
with:
go-version: '>=1.20.1'
- name: Draft release
uses: https://gitea.com/actions/release-action@main
with:
body: ${{ env.release_body }}
draft: true
api_key: '${{ secrets.RELEASE_TOKEN }}'

2
.github/FUNDING.yml vendored Normal file
View file

@ -0,0 +1,2 @@
github: alterNERDtive
ko_fi: alterNERDtive

12
.github/dependabot.yaml vendored Normal file
View file

@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: "nuget"
directory: "/"
target-branch: "develop"
schedule:
interval: "daily"
- package-ecosystem: "github-actions"
directory: "/"
target-branch: "develop"
schedule:
interval: "daily"

30
.github/workflows/create-release.yaml vendored Normal file
View file

@ -0,0 +1,30 @@
name: Create release on tag push
on:
push:
tags:
- 'release/*'
jobs:
build:
name: Build bindED
runs-on: windows-latest
permissions:
contents: write
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1.1
- name: Build
run: msbuild -t:build -p:configuration=release
- name: Draft release
uses: ncipollo/release-action@v1
with:
artifacts: "bindEDplugin.zip"
bodyFile: "CHANGELOG.md"
draft: true

21
.github/workflows/gh-pages.yaml vendored Normal file
View file

@ -0,0 +1,21 @@
name: Deploy github pages on tag push
on:
push:
tags:
- 'release/*'
jobs:
build:
name: Deploy documentation
runs-on: ubuntu-latest
steps:
- name: Checkout source code
uses: actions/checkout@v2
- name: Deploy docs
uses: mhausenblas/mkdocs-deploy-gh-pages@nomaterial
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REQUIREMENTS: requirements.txt

2
.gitignore vendored
View file

@ -1,4 +1,6 @@
.vs/**
obj/**
bin/**
site/**
bindEDplugin.csproj.user
*.zip

174
CHANGELOG.md Normal file
View file

@ -0,0 +1,174 @@
# 5.0.0 (2024-05-03)
## Removed
* Will no longer copy Odyssey (live) binds to Horizons (legacy) binds. I doubt
anyone still plays the latter; if you do, dont upgrade the pulgin.
## Fixed
* Will now find binds files again for the latest Elite update which changed
the format to `<name>.4.1.binds`.
# 4.2.2 (2022-05-31)
## Fixed
* Added specific error message for invoking the plugin without context (#30).
* Clarified that the default `en-US` layout will wrok for most keys on most
layouts. (#32)
-----
# 4.2.1 (2021-12-24)
## Fixed
* Added support for Odysseys new `StartPreset.4.start` file; the preset
selected in the Odyssey client will take precedence, so make sure you use the
same preset for Horizons (#29).
-----
# 4.2 (2021-08-13)
## Added
* Pretty printed documentation! You can find it at
https://alterNERDtive.github.io/bindED.
* Troubleshooting guide! You can find it at
https://alterNERDtive.github.io/bindED/troubleshooting.
* `diagnostics` plugin context: writes current plugin state to the log for
troubleshooting.
* `bindED-diagnostics` profile: runs the `diagnostics` plugin context on load.
Should be the first troubleshooting step.
* Error message if multiple control presets are in use (Odyssey only).
## Fixed
* Now correctly loads presets that contain regex special characters (#28).
-----
# 4.1 (2021-05-22)
## Added
* optional `~bindsFile` parameter for the `loadbinds` plugin context: use that
to specify a binds file instead of auto-detecting it from the currently active
preset. (#18)
## Changed
* Updated the README to reflect that you need to load the game once, and that
you need to have changed at least a single bind. (#19)
* Updated the README to reflect that you have to use a single preset for all
sections if youre playing Odyssey.
## Fixed
* Now only reading the first line of `startPreset.start` to work correctly with
Odyssey. (#15)
* Now correctly prioritizing `.4.0.binds` > `.3.0.binds` > `.binds`. (#20)
-----
# 4.0 (2021-05-19)
**Note**: If you do not own Odyssey, everything will work just as before!
I, too, do not own Odyssey. So while I have tried testing various things with
mock Odyssey binds files, please keep an eye out for bugs and [file an
issue](https://github.com/alterNERDtive/bindED/issues/new/) if you
encounter any. And check back for a potential 4.0.1 soon. TYVM!
**IMPORTANT**: Please backup your binds files before installing this release,
just in case. You can find them in
`%localappdata%\Frontier Developments\Elite Dangerous\Options\Bindings`.
Sadly for the time being Odyssey and Horizons will basically be separate games.
That also means they have separate binds files.
BindED will by default always use the last edited file, be that the base preset,
Horizons or Odyssey.
To keep hassle to a minimum, the recommended way to change binds is to do it
from Odyssey. When a change to the Odyssey file is detected, the plugin will
by default overwrite Horizons binds with it. To prevent that and keep entirely
separate binds, you can set `bindED.disableHorizonsSync#` (yes, including the
pound sign) to `true` in your VoiceAttack profile.
## Added
* Odyssey binds file support (`*.4.0.binds`). (#14)
* `bindED.disableHorizonsSync#` configuration option: Set this (to `true`) in
your VoiceAttack profile to disable automatically syncing Odyssey binds
changes to Horizons binds.
## Removed
* empty plugin context: Invoking the plugin without context no longer gives a
deprecation warning and will instead fail.
* binds file as plugin context: Invoking the plugin with a binds file as context
no longer gives a deprecation warning and will instead fail.
-----
# 3.1 (2021-01-29)
## Changed
* Invoking the `loadbinds` context will now force reset everything and reload
from scratch. (#5)
## Added
* The current layouts key map file is now monitored for changes. Should make
adding support for new layouts slightly less annoying. (#4)
-----
# 3.0 (2020-11-12)
I did a complete refactoring of everything to prepare for some juicy new
features! Sadly that also meant breaking backwards compatibility. On the plus
side, the things that no longer work like they did in Garys initial release
should basically never be used anyway.
## Removed
* You can no longer specify binding files to use by linking them into the plugin
directory.
* You can no longer specify binding files by using them as the plugin context.
## Changed
* Invoking the plugin with no context or with a binds file as context is now
deprecated and will be removed in a future version. Use the `loadbinds`
context instead.
## Added
* `en-gb` key map. Thank you A.Cyprus for the work on that!
* Bindings are now automagically read when VoiceAttack loads and when
`bindED.layout#` is changed.
* After the initial reading of bindings the plugin will monitor the bindings
directory for changes to a) the `StartPreset.start` file (preset has changed)
and b) the binds file(s) corresponding to the current preset. Changes are
automatically applied. (#3)
* The `listbinds` context will set the text variable `~bindED.bindsList` to a
list of bindings present in the current bindings file. (#1)
* The `missingbinds` context will create a report of missing binds (anything
that doesnt have keyboard binds) and save it to `~bindED.missingBinds`. (#2)
* The included `bindED-reports` profile runs a missing binds report and a binds
list report when you load it and saves them to your Desktop.
-----
# 2.0 (2020-09-23)
## Added
* Support for non-US keyboard layouts. `de-neo2` is included (because thats
what Im using), others can be added ([see the wiki for
instructions](https://github.com/alterNERDtive/bindED/wiki/Keyboard-Layouts)).

25
Directory.build.props Normal file
View file

@ -0,0 +1,25 @@
<Project>
<PropertyGroup>
<LangVersion>10.0</LangVersion>
<Nullable>enable</Nullable>
</PropertyGroup>
<!-- StyleCop Analyzers configuration -->
<PropertyGroup>
<CodeAnalysisRuleSet>$(SolutionDir)StyleCop.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.1.118">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers.Error" Version="1.0.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="StyleCop.CSharp.Async.Rules" Version="6.1.41">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<AdditionalFiles Include="$(SolutionDir)stylecop.json" Link="stylecop.json" />
</ItemGroup>
</Project>

165
EDMap-en-gb.txt Normal file
View file

@ -0,0 +1,165 @@
Key_Backspace;8
Key_Tab;9
Key_Enter;13
Key_Pause;19
Key_CapsLock;20
Key_Kana;21
Key_Kanji;25
Key_Escape;27
Key_Convert;28
Key_NoConvert;29
Key_Space;32
Key_PageUp;33
Key_PageDown;34
Key_End;35
Key_Home;36
Key_LeftArrow;37
Key_UpArrow;38
Key_RightArrow;39
Key_DownArrow;40
Key_SYSRQ;44
Key_Insert;45
Key_Delete;46
Key_0;48
Key_1;49
Key_2;50
Key_3;51
Key_4;52
Key_5;53
Key_6;54
Key_7;55
Key_8;56
Key_9;57
Key_A;65
Key_B;66
Key_C;67
Key_D;68
Key_E;69
Key_F;70
Key_G;71
Key_H;72
Key_I;73
Key_J;74
Key_K;75
Key_L;76
Key_M;77
Key_N;78
Key_O;79
Key_P;80
Key_Q;81
Key_R;82
Key_S;83
Key_T;84
Key_U;85
Key_V;86
Key_W;87
Key_X;88
Key_Y;89
Key_Z;90
Key_LeftWin;91
Key_RightWin;92
Key_Apps;93
Key_Sleep;95
Key_Numpad_0;96
Key_Numpad_1;97
Key_Numpad_2;98
Key_Numpad_3;99
Key_Numpad_4;100
Key_Numpad_5;101
Key_Numpad_6;102
Key_Numpad_7;103
Key_Numpad_8;104
Key_Numpad_9;105
Key_Numpad_Multiply;106
Key_Numpad_Add;107
Key_Numpad_Subtract;109
Key_Numpad_Decimal;110
Key_Numpad_Comma;110
Key_Numpad_Divide;111
Key_Numpad_Enter;156
Key_F1;112
Key_F2;113
Key_F3;114
Key_F4;115
Key_F5;116
Key_F6;117
Key_F7;118
Key_F8;119
Key_F9;120
Key_F10;121
Key_F11;122
Key_F12;123
Key_F13;124
Key_F14;125
Key_F15;126
Key_F16;127
Key_F17;128
Key_F18;129
Key_F19;130
Key_F20;131
Key_F21;132
Key_F22;133
Key_F23;134
Key_F24;135
Key_NumLock;144
Key_ScrollLock;145
Key_LeftShift;160
Key_RightShift;161
Key_LeftControl;162
Key_RightControl;163
Key_LeftAlt;164
Key_RightAlt;165
Key_WebBack;166
Key_WebForward;167
Key_WebRefresh;168
Key_WebStop;169
Key_WebSearch;170
Key_WebFavourites;171
Key_WebHome;172
Key_Mute;173
Key_VolumeDown;174
Key_VolumeUp;175
Key_NextTrack;176
Key_PrevTrack;177
Key_MediaStop;178
Key_Stop;178
Key_PlayPause;179
Key_Mail;180
Key_MediaSelect;181
Key_SemiColon;186
Key_Plus;187
Key_Equals;187
Key_Comma;188
Key_Minus;189
Key_Period;190
Key_Slash;191
Key_Grave;223
Key_LeftBracket;219
Key_BackSlash;220
Key_RightBracket;221
Key_Apostrophe;192
Key_OEM_102;226
Key_ä;222
Key_ö;192
Key_ü;186
Key_ß;219
Key_Acute;221
Key_LessThan;226
Key_Circumflex;220
Key_Hash;222
Key_Colon;186
Key_ABNT_C1;-1
Key_Yen;-1
Key_ABNT_C2;-1
Key_Numpad_Equals;-1
Key_Underline;-1
Key_AX;-1
Key_Unlabeled;-1
Key_Calculator;-1
Key_AT;-1
Key_Power;-1
Key_Wake;-1
Key_MyComputer;-1
Key_GreenModifier;-1
Key_OrangeModifier;-1

26
GlobalSuppressions.cs Normal file
View file

@ -0,0 +1,26 @@
// <copyright file="GlobalSuppressions.cs" company="alterNERDtive">
// Copyright 20202022 alterNERDtive.
//
// This file is part of bindED VoiceAttack plugin.
//
// bindED VoiceAttack plugin is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// bindED VoiceAttack plugin is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with bindED VoiceAttack plugin. If not, see &lt;https://www.gnu.org/licenses/&gt;.
// </copyright>
// This file is used by Code Analysis to maintain SuppressMessage
// attributes that are applied to this project.
// Project-level suppressions either have no target or are given
// a specific target and scoped to a namespace, type, member, etc.
using System.Diagnostics.CodeAnalysis;
[assembly: SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "just cause", Scope = "namespace", Target = "~N:bindEDplugin")]

675
LICENSE
View file

@ -1,13 +1,674 @@
bindED Source Code License - Please read carefully
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
March 7, 2018
Preamble
bindED could have been written by monkeys, so, it's safe to say there's
not much to protect here, so, have at it.
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
In other words, this is public domain with no strings attached -- Go for it!
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
Gary L. Magenheimer
VoiceAttack.com
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.

7
Makefile Normal file
View file

@ -0,0 +1,7 @@
.PHONY: docs deploy-docs
docs:
mkdocs build -c
deploy-docs:
mkdocs gh-deploy -cs

View file

@ -1,53 +1,30 @@
# bindED
# bindED
This VoiceAttack plugin reads keybindings in Elite:Dangerous and stores them as
VoiceAttack variables. It has originally been written by Gary (the developer of
VoiceAttack variables. It was originally written by Gary (the developer of
VoiceAttack) [and published on the VoiceAttack
forums](https://forum.voiceattack.com/smf/index.php?topic=564.0).
forums](https://forum.voiceattack.com/smf/index.php?topic=564.0). You can find
the [original README here](https://alterNERDtive.github.io/bindED/ReadMe.txt)
for reference.
You can find the [original README here](ReadMe.txt).
I have basically done a complete rewrite of the original source code at this point
and added a lot of features including automatic detection of the correct
bindings file and support for non-US keyboard layouts (see below for details).
I have taken the original source code and added automatic detection of the
correct bindings file and support for non-US keyboard layouts.
## Documentation & Installation Guide
## Automatic Bindings Detection
You can find [comprehensive documentation on Github
Pages](https://alterNERDtive.github.io/bindED).
Elite creates a file `StartPreset.start` in the Bindings directory that contains
the name of the currently active profile. The plugin now reads that file and
loads the correct profile automatically.
## Need Help / Want to Contribute?
Should the file for some reason a) not exist, b) be empty or c) contain an
invalid preset name the old default is used: the most recently changed `.binds`
file.
Have a look at [the troubleshooting
guide](https://alterNERDtive.github.io/bindED/troubleshooting). If your problem
persists, please [file an
issue](https://github.com/alterNERDtive/bindED/issues/new). Thanks! :)
You can still manually provide a bindings file to use instead by setting it as
the plugin context, as before.
You can also [say “Hi” on Discord](https://discord.gg/YeXh2s5UC6) if that is
your thing.
## Support for non-US Keyboard Layouts
If you are using any non-US layout you might have noticed that some binds dont
work. Elite internally uses keycode values (a number assigned to each key on the
keyboard) for its bindings but for some reason both displays and saves them as
keysyms (the label on the key), according to the UK QWERTY keyboard layout. That
means VoiceAttack cant just send the keysym it reads from a binding, it has to
translate it into the corresponding keycode.
The original plugin contained a `EDMap.txt` file that contains infomration on
that conversion _for the US keyboard layout_. If you are using any other layout
that information will be incorrect for any symbols that are on a different key
than they are on the US layout.
I have added the option to use maps for other keyboard layouts. In order to do
so you will have to set a text variable in VoiceAttack called `bindED.layout` to
the layout you want to use before invoking the plugin. If the variable is not
set it will defaut to “en-us”, leaving the original behaviour intact.
I have included a map file for [Neo2](https://neo-layout.org)
(`EDMap-de-neo2.txt`) which is the layout that I am using personally. If you are
on a different layout, you will have to create a corresponding map file yourself
or prod me to add it. E.g. for the french AZERTY it would be `EDMap-fr-fr.text`
and set `bindED.layout` to “fr-fr”. For US Dvorak, `EDmap-en-us-dvorak` and
“en-us-dvorak”. You can see where this is going.
For more information on [creating new supported keyboard layouts see the
Wiki](https://github.com/alterNERDtive/bindED/wiki/Keyboard-Layouts).
[![GitHub Sponsors](https://img.shields.io/github/sponsors/alterNERDtive?style=for-the-badge)](https://github.com/sponsors/alterNERDtive)
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/S6S1DLYBS)

0
StyleCop.ruleset Normal file
View file

BIN
VoiceAttack.exe Normal file

Binary file not shown.

Binary file not shown.

BIN
bindED-reports-Profile.vap Normal file

Binary file not shown.

659
bindED.cs
View file

@ -1,208 +1,519 @@
using System;
// <copyright file="bindED.cs" company="alterNERDtive">
// Copyright 20202024 alterNERDtive.
//
// This file is part of bindED VoiceAttack plugin.
//
// bindED VoiceAttack plugin is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// bindED VoiceAttack plugin is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with bindED VoiceAttack plugin. If not, see &lt;https://www.gnu.org/licenses/&gt;.
// </copyright>
#nullable enable
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading;
using System.Xml.Linq;
namespace bindEDplugin
{
/// <summary>
/// This VoiceAttack plugin reads Elite Dangerous .binds files for keyboard
/// bindings and makes them available in VoiceAttack variables.
/// </summary>
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "historic, grandfathered in")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name should match first type name", Justification = "historic, grandfathered in")]
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE1006:Naming Styles", Justification = "historic, grandfathered in")]
public class bindEDPlugin
{
private static Dictionary<String, int> _map = null;
private static readonly Version VERSION = new ("5.0.1");
public static string VERSION = "2.0";
private static readonly string BindingsDir = Path.Combine(
Environment.GetFolderPath(
Environment.SpecialFolder.LocalApplicationData),
@"Frontier Developments\Elite Dangerous\Options\Bindings");
private static readonly Dictionary<string, int> FileEventCount = new ();
[System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1306:Field names should begin with lower-case letter", Justification = "just cause")]
private static dynamic? VA;
private static string? pluginPath;
private static FileSystemWatcher? bindsWatcher;
private static FileSystemWatcher? mapWatcher;
private static string? layout;
private static Dictionary<string, int>? keyMap;
private static string? preset;
private static Dictionary<string, List<string>>? binds;
private static FileSystemWatcher BindsWatcher
{
get
{
if (bindsWatcher == null)
{
bindsWatcher = new FileSystemWatcher(BindingsDir);
bindsWatcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.FileName;
bindsWatcher.Changed += (source, eventArgs) => { FileChangedHandler(eventArgs.Name); };
bindsWatcher.Created += (source, eventArgs) => { FileChangedHandler(eventArgs.Name); };
bindsWatcher.Renamed += (source, eventArgs) => { FileChangedHandler(eventArgs.Name); };
}
return bindsWatcher!;
}
}
private static FileSystemWatcher MapWatcher
{
get
{
if (mapWatcher == null)
{
mapWatcher = new FileSystemWatcher(pluginPath);
mapWatcher.NotifyFilter = NotifyFilters.LastWrite | NotifyFilters.FileName;
mapWatcher.Changed += (source, eventArgs) => { FileChangedHandler(eventArgs.Name); };
mapWatcher.Created += (source, eventArgs) => { FileChangedHandler(eventArgs.Name); };
mapWatcher.Renamed += (source, eventArgs) => { FileChangedHandler(eventArgs.Name); };
}
return mapWatcher!;
}
}
private static string? Layout
{
get => layout ??= VA?.GetText("bindED.layout#") ?? "en-us";
set
{
layout = value;
KeyMap = null;
}
}
private static Dictionary<string, int>? KeyMap
{
get => keyMap ??= LoadKeyMap(Layout!);
set => keyMap = value;
}
private static string? Preset
{
get => preset ??= DetectPreset();
set
{
preset = value;
Binds = null;
}
}
private static Dictionary<string, List<string>>? Binds
{
get => binds ??= ReadBinds(DetectBindsFile(Preset!));
set => binds = value;
}
/// <summary>
/// The plugins display name, as required by the VoiceAttack plugin API.
/// </summary>
/// <returns>The display name.</returns>
public static string VA_DisplayName() => $"bindED Plugin v{VERSION}-alterNERDtive";
public static string VA_DisplayInfo() => "bindED Plugin\r\n\r\n2016 VoiceAttack.com\r\n2020 alterNERDtive";
/// <summary>
/// The plugins description, as required by the VoiceAttack plugin API.
/// </summary>
/// <returns>The description.</returns>
public static string VA_DisplayInfo() => "bindED Plugin\r\n\r\n2016 VoiceAttack.com\r\n20202024 alterNERDtive";
public static Guid VA_Id() => new Guid("{524B4B9A-3965-4045-A39A-A239BF6E2838}");
/// <summary>
/// The plugins GUID, as required by the VoiceAttack plugin API.
/// </summary>
/// <returns>The GUID.</returns>
public static Guid VA_Id() => new ("{524B4B9A-3965-4045-A39A-A239BF6E2838}");
public static void VA_Init1(dynamic vaProxy) => LoadBinds(vaProxy, false);
public static void VA_Invoke1(dynamic vaProxy) => LoadBinds(vaProxy, true);
public static void VA_StopCommand() { }
public static void VA_Exit1(dynamic vaProxy) { }
private static String GetPluginPath(dynamic vaProxy) => Path.GetDirectoryName(vaProxy.PluginPath());
public static void LoadBinds(dynamic vaProxy, Boolean fromInvoke)
/// <summary>
/// The Init method, as required by the VoiceAttack plugin API.
/// Runs when the plugin is initially loaded.
/// </summary>
/// <param name="vaProxy">The VoiceAttack proxy object.</param>
public static void VA_Init1(dynamic vaProxy)
{
String strDir = GetPluginPath(vaProxy);
VA = vaProxy;
VA.TextVariableChanged += new Action<string, string, string, Guid?>(TextVariableChanged);
pluginPath = Path.GetDirectoryName(VA.PluginPath());
VA.SetText("bindED.version", VERSION.ToString());
VA.SetText("bindED.fork", "alterNERDtive");
try
{
string layout = vaProxy.GetText("bindED.layout");
string mapFile = (layout == null ? "EDMap-en-us.txt" : $"EDMap-{layout.ToLower()}.txt");
String strMap = Path.Combine(strDir, mapFile);
if (File.Exists(strMap))
LoadBinds(Binds);
}
catch (Exception e)
{
LogError(e.Message);
}
finally
{
BindsWatcher.EnableRaisingEvents = true;
MapWatcher.EnableRaisingEvents = true;
}
}
/// <summary>
/// The Invoke method, as required by the VoiceAttack plugin API.
/// Runs whenever a plugin context is invoked.
/// </summary>
/// <param name="vaProxy">The VoiceAttack proxy object.</param>
public static void VA_Invoke1(dynamic vaProxy)
{
VA = vaProxy;
try
{
string context = VA.Context.ToLower();
if (context == "diagnostics")
{
_map = new Dictionary<string, int>(256);
foreach (String line in File.ReadAllLines(strMap, System.Text.Encoding.UTF8))
LogInfo($"current keybord layout: {Layout}");
LogInfo($"current preset: {Preset}");
LogInfo($"detected binds file: {new FileInfo(DetectBindsFile(Preset!)).Name}");
LogInfo($"detected binds file (full path): {DetectBindsFile(Preset!)}");
}
else if (context == "listbinds")
{
ListBinds(Binds, VA.GetText("bindED.separator") ?? "\r\n");
}
else if (context == "loadbinds")
{
// force reset everything
Layout = null;
Preset = null;
if (!string.IsNullOrWhiteSpace(VA.GetText("~bindsFile")))
{
String[] arItem = line.Split(";".ToCharArray(), 2, StringSplitOptions.RemoveEmptyEntries);
if ((arItem.Count() == 2) && (!String.IsNullOrWhiteSpace(arItem[0])) && (!_map.ContainsKey(arItem[0])))
{
ushort iKey;
if (ushort.TryParse(arItem[1], out iKey))
{
if (iKey > 0 && iKey < 256)
_map.Add(arItem[0].Trim(), iKey);
}
}
Binds = ReadBinds(Path.Combine(BindingsDir, VA.GetText("~bindsFile")));
}
LoadBinds(Binds);
}
else if (context == "missingbinds")
{
MissingBinds(Binds);
}
else
{
vaProxy.WriteToLog($"bindED Error - {mapFile} does not exist. Make sure the {mapFile} file exists in the same folder as this plugin, otherwise this plugin has nothing to process and cannot continue.", "red");
return;
}
}
catch (Exception ex)
{
vaProxy.WriteToLog("bindED Error - " + ex.Message, "red");
return;
}
if (_map.Count == 0)
{
vaProxy.WriteToLog("bindED Error - EDMap.txt does not contain any elements.", "red");
return;
}
String[] files = null;
if (fromInvoke)
{
if (!String.IsNullOrWhiteSpace(vaProxy.Context))
{
files = ((String)vaProxy.Context).Split(";".ToCharArray(), StringSplitOptions.RemoveEmptyEntries);
}
else
{
String strBindsDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), @"Frontier Developments\Elite Dangerous\Options\Bindings");
if (System.IO.Directory.Exists(strBindsDir))
if (string.IsNullOrWhiteSpace(context))
{
FileInfo[] bindFiles = null;
string startFile = Path.Combine(strBindsDir, "StartPreset.start");
DirectoryInfo dirInfo = new DirectoryInfo(strBindsDir);
if (File.Exists(startFile))
{
bindFiles = dirInfo.GetFiles().Where(i => Regex.Match(i.Name, $@"{File.ReadAllText(startFile)}(\.3\.0)?\.binds$").Success).OrderByDescending(p => p.LastWriteTime).ToArray();
}
if ((bindFiles?.Count() ?? 0) == 0)
{
bindFiles = dirInfo.GetFiles().Where(i => i.Extension == ".binds").OrderByDescending(p => p.LastWriteTime).ToArray();
}
if (bindFiles.Count() > 0)
files = new string[] { bindFiles[0].FullName };
}
}
}
else
{
try
{
files = System.IO.Directory.GetFiles(strDir, "*.lnk", SearchOption.TopDirectoryOnly);
IWshRuntimeLibrary.WshShell shell = new IWshRuntimeLibrary.WshShell();
for (int i = 0; i < files.Count(); i++)
{
files[i] = ((IWshRuntimeLibrary.IWshShortcut)shell.CreateShortcut(files[i])).TargetPath;
}
}
catch (Exception ex)
{
vaProxy.WriteToLog("bindED Error - " + ex.Message, "red");
return;
}
}
try
{
foreach (String file in files)
{
if (File.Exists(file))
{
XElement rootElement = null;
try
{
rootElement = XElement.Load(file);
}
catch (Exception ex)
{
vaProxy.WriteToLog("bindED Error - " + ex.Message, "red");
return;
}
if (rootElement != null)
{
foreach (XElement c in rootElement.Elements().Where(i => i.Elements().Count() > 0))
{
foreach (var element in c.Elements().Where(i => i.HasAttributes))
{
List<int> _keys = new List<int>();
if (element.Name == "Primary")
{
if (element.Attribute("Device").Value == "Keyboard" && !String.IsNullOrWhiteSpace(element.Attribute("Key").Value) && element.Attribute("Key").Value.StartsWith("Key_"))
{
foreach (var modifier in element.Elements().Where(i => i.Name.LocalName == "Modifier"))
{
if (_map.ContainsKey(modifier.Attribute("Key").Value))
_keys.Add(_map[modifier.Attribute("Key").Value]);
}
if (_map.ContainsKey(element.Attribute("Key").Value))
_keys.Add(_map[element.Attribute("Key").Value]);
}
}
if (_keys.Count == 0) //nothing found in primary... look in secondary
{
if (element.Name == "Secondary")
{
if (element.Attribute("Device").Value == "Keyboard" && !String.IsNullOrWhiteSpace(element.Attribute("Key").Value) && element.Attribute("Key").Value.StartsWith("Key_"))
{
foreach (var modifier in element.Elements().Where(i => i.Name.LocalName == "Modifier"))
{
if (_map.ContainsKey(modifier.Attribute("Key").Value))
_keys.Add(_map[modifier.Attribute("Key").Value]);
}
if (_map.ContainsKey(element.Attribute("Key").Value))
_keys.Add(_map[element.Attribute("Key").Value]);
}
}
}
if (_keys.Count > 0)
{
String strTextValue = String.Empty;
foreach (int key in _keys)
strTextValue += String.Format("[{0}]", key);
vaProxy.SetText("ed" + c.Name.LocalName, strTextValue);
}
}
}
}
LogError("Empty plugin context.");
}
else
{
vaProxy.WriteToLog("bindED Error - The target file indicated by the shortcut does not exist: " + file, "red");
return;
LogError($"Invalid plugin context '{context}'.");
}
LogError("You generally do not need to invoke the plugin manually.");
}
}
catch (Exception e)
{
LogError(e.Message);
}
}
/// <summary>
/// The Exit method, as required by the VoiceAttack plugin API.
/// Runs when VoiceAttack is shut down.
/// </summary>
/// <param name="vaProxy">The VoiceAttack proxy object.</param>
[System.Diagnostics.CodeAnalysis.SuppressMessage("Style", "IDE0060:Remove unused parameter", Justification = "required by VoiceAttack plugin API")]
public static void VA_Exit1(dynamic vaProxy)
{
}
/// <summary>
/// The StopCommand method, as required by the VoiceAttack plugin API.
/// Runs whenever all commands are stopped using the “Stop All Commands”
/// button or action.
/// </summary>
public static void VA_StopCommand()
{
}
private static void TextVariableChanged(string name, string from, string to, Guid? internalID = null)
{
if (name == "bindED.layout#")
{
LogInfo($"Keyboard layout changed to '{to}', reloading …");
Layout = to;
try
{
LoadBinds(Binds);
}
catch (Exception e)
{
LogError(e.Message);
}
}
}
private static void LogError(string message)
{
VA!.WriteToLog($"ERROR | bindED: {message}", "red");
}
private static void LogInfo(string message)
{
VA!.WriteToLog($"INFO | bindED: {message}", "blue");
}
private static void LogWarn(string message)
{
VA!.WriteToLog($"WARN | bindED: {message}", "yellow");
}
private static void ListBinds(Dictionary<string, List<string>>? binds, string separator)
{
VA!.SetText("~bindED.bindsList", string.Join(separator, binds!.Keys));
LogInfo("List of Elite binds saved to TXT variable '~bindED.bindsList'.");
}
private static void LoadBinds(Dictionary<string, List<string>>? binds)
{
foreach (KeyValuePair<string, List<string>> bind in binds!)
{
string value = string.Empty;
bool valid = true;
if (bind.Value.Count == 0)
{
// LogInfo($"No keyboard bind for '{bind.Key}' found, skipping …");
}
else
{
foreach (string key in bind.Value)
{
if (KeyMap!.ContainsKey(key))
{
value += $"[{KeyMap[key]}]";
}
else
{
valid = false;
LogError($"No valid key code for '{key}' found, skipping bind for '{bind.Key}' …");
}
}
if (valid)
{
VA!.SetText(bind.Key, value);
}
}
}
catch(Exception ex)
LogInfo($"Elite binds '{(string.IsNullOrWhiteSpace(VA!.GetText("~bindsFile")) ? Preset : VA!.GetText("~bindsFile"))}' for layout '{Layout}' loaded successfully.");
}
private static void MissingBinds(Dictionary<string, List<string>>? binds)
{
List<string> missing = new (256);
foreach (KeyValuePair<string, List<string>> bind in binds!)
{
vaProxy.WriteToLog("bindED Error - " + ex.Message, "red");
return;
if (bind.Value.Count == 0)
{
missing.Add(bind.Key);
}
}
if (missing.Count > 0)
{
VA!.SetText("~bindED.missingBinds", string.Join("\r\n", missing));
VA!.SetBoolean("~bindED.missingBinds", true);
LogInfo("List of missing Elite binds saved to TXT variable '~bindED.missingBinds'.");
}
else
{
LogInfo($"No missing keyboard binds found.");
}
}
private static Dictionary<string, int> LoadKeyMap(string layout)
{
string mapFile = Path.Combine(pluginPath, $"EDMap-{layout.ToLower()}.txt");
if (!File.Exists(mapFile))
{
throw new FileNotFoundException($"No map file for layout '{layout}' found.");
}
Dictionary<string, int> map = new (256);
foreach (string line in File.ReadAllLines(mapFile, System.Text.Encoding.UTF8))
{
string[] arItem = line.Split(";".ToCharArray(), 2, StringSplitOptions.RemoveEmptyEntries);
if ((arItem.Count() == 2) && (!string.IsNullOrWhiteSpace(arItem[0])) && (!map.ContainsKey(arItem[0])))
{
ushort iKey;
if (ushort.TryParse(arItem[1], out iKey))
{
if (iKey > 0 && iKey < 256)
{
map.Add(arItem[0].Trim(), iKey);
}
}
}
}
if (map.Count == 0)
{
throw new Exception($"Map file for {layout} does not contain any elements.");
}
return map;
}
private static string DetectPreset()
{
string startFile = Path.Combine(BindingsDir, "StartPreset.4.start");
if (!File.Exists(startFile))
{
startFile = Path.Combine(BindingsDir, "StartPreset.start");
if (!File.Exists(startFile))
{
throw new FileNotFoundException("No 'StartPreset.start' file found. Please run Elite: Dangerous at least once, then restart VoiceAttack.");
}
}
IEnumerable<string> presets = File.ReadAllLines(startFile).Distinct();
if (presets.Count() > 1)
{
LogError($"You have selected multiple control presets ('{string.Join("', '", presets)}'). "
+ $"Only binds from '{presets.First()}' will be used. Please refer to the documentation for more information.");
}
return presets.First();
}
private static string DetectBindsFile(string preset)
{
DirectoryInfo dirInfo = new (BindingsDir);
FileInfo[] bindFiles = dirInfo.GetFiles()
.Where(i => Regex.Match(i.Name, $@"^{Regex.Escape(preset)}\.4\.\d\.binds$").Success)
.OrderByDescending(p => p.Name).ToArray();
if (bindFiles.Count() == 0)
{
bindFiles = dirInfo.GetFiles($"{preset}.binds");
if (bindFiles.Count() == 0)
{
throw new FileNotFoundException($"No bindings file found for preset '{preset}'. If this is a default preset, please change anything in Elites controls options.");
}
}
return bindFiles[0].FullName;
}
private static Dictionary<string, List<string>> ReadBinds(string file)
{
XElement rootElement;
rootElement = XElement.Load(file);
Dictionary<string, List<string>> binds = new (512);
if (rootElement != null)
{
foreach (XElement c in rootElement.Elements().Where(i => i.Elements().Count() > 0))
{
List<string> keys = new ();
foreach (var element in c.Elements().Where(i => i.HasAttributes))
{
if (element.Name == "Primary")
{
if (element.Attribute("Device").Value == "Keyboard"
&& !string.IsNullOrWhiteSpace(element.Attribute("Key").Value) && element.Attribute("Key").Value.StartsWith("Key_"))
{
foreach (var modifier in element.Elements().Where(i => i.Name.LocalName == "Modifier"))
{
keys.Add(modifier.Attribute("Key").Value);
}
keys.Add(element.Attribute("Key").Value);
}
}
if (keys.Count == 0 && element.Name == "Secondary")
{ // nothing found in primary... look in secondary
if (element.Attribute("Device").Value == "Keyboard"
&& !string.IsNullOrWhiteSpace(element.Attribute("Key").Value) && element.Attribute("Key").Value.StartsWith("Key_"))
{
foreach (var modifier in element.Elements().Where(i => i.Name.LocalName == "Modifier"))
{
keys.Add(modifier.Attribute("Key").Value);
}
keys.Add(element.Attribute("Key").Value);
}
}
}
binds.Add($"ed{c.Name.LocalName}", keys);
}
}
return binds;
}
private static void FileChangedHandler(string name)
{
// so apparently these events all fire twice … lets make sure we only handle it once.
if (FileEventCount.ContainsKey(name))
{
FileEventCount[name] += 1;
}
else
{
FileEventCount.Add(name, 1);
}
if (FileEventCount[name] % 2 == 0)
{
try
{
// lets make semi-sure that the file isnt locked …
// FIXXME: solve this properly
Thread.Sleep(500);
// Going by name only is a bit naïve given were watching 2
// separate directories, but hey … worst case if something
// is doing unintended things is unnecessarily reloading the
// binds.
if (name == $"EDMap-{Layout!.ToLower()}.txt")
{
LogInfo($"Key map for layout '{Layout}' has changed, reloading …");
KeyMap = null;
LoadBinds(Binds);
}
else if (name == "StartPreset.start")
{
LogInfo("Controls preset has changed, reloading …");
Preset = null;
LoadBinds(Binds);
}
else if (Regex.Match(name, $@"^{Regex.Escape(preset)}\.4\.\d\.binds$").Success)
{
LogInfo($"Bindings file '{name}' has changed, reloading …");
Binds = null;
LoadBinds(Binds);
}
}
catch (Exception e)
{
LogError(e.Message);
}
}
}
}

View file

@ -9,7 +9,7 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>bindEDplugin</RootNamespace>
<AssemblyName>bindEDplugin</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
@ -21,6 +21,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
@ -29,6 +30,7 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet />
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
@ -38,6 +40,7 @@
</ItemGroup>
<ItemGroup>
<Compile Include="bindED.cs" />
<Compile Include="GlobalSuppressions.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
@ -52,37 +55,43 @@
</COMReference>
</ItemGroup>
<ItemGroup>
<None Include="docs\index.md" />
<Content Include=".gitignore" />
<Content Include="EDMap-de-neo2.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="EDMap-en-gb.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="EDMap-en-us.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="ReadMe.txt">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Include="docs\ReadMe.txt" />
</ItemGroup>
<ItemGroup>
<None Include=".editorconfig" />
<None Include="bindED-diagnostics-Profile.vap">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="bindED-reports-Profile.vap">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="CHANGELOG.md" />
<None Include="docs\troubleshooting.md" />
<None Include="LICENSE">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="mkdocs.yml" />
<None Include="README.md">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<PropertyGroup>
<PreBuildEvent>powershell if (Test-Path '$(SolutionDir)bindEDplugin.zip') { Remove-Item -Path '$(SolutionDir)bindEDplugin.zip' }</PreBuildEvent>
</PropertyGroup>
<PropertyGroup>
<PostBuildEvent>if $(ConfigurationName) == Release (powershell Compress-Archive -Path '$(TargetDir)' -DestinationPath '$(SolutionDir)bindEDplugin.zip' -Force)</PostBuildEvent>
</PropertyGroup>
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target> -->
<Target Name="AfterBuild" Condition=" '$(Configuration)' == 'Release' ">
<ZipDirectory SourceDirectory="bin" DestinationFile="bindEDplugin.zip" Overwrite="true" />
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -1,10 +1,19 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.30517.126
# Visual Studio Version 17
VisualStudioVersion = 17.3.32519.111
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bindEDplugin", "bindEDplugin.csproj", "{C8AC9134-639D-45D2-B5EF-138E0550E0C9}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{FC89314B-E504-4D5D-BB48-F1E3E4980A13}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.github\workflows\create-release.yaml = .github\workflows\create-release.yaml
Directory.build.props = Directory.build.props
GlobalSuppressions.cs = GlobalSuppressions.cs
stylecop.json = stylecop.json
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU

Binary file not shown.

View file

@ -1,4 +1,4 @@
----------------------------------------------------------------
----------------------------------------------------------------
About the bindED plugin - v1.0.0.1 (See end for version history)
----------------------------------------------------------------

BIN
docs/images/keypress.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

77
docs/index.md Normal file
View file

@ -0,0 +1,77 @@
# bindED
This VoiceAttack plugin reads keybindings in Elite:Dangerous and stores them as
VoiceAttack variables. It was originally written by Gary (the developer of
VoiceAttack) [and published on the VoiceAttack
forums](https://forum.voiceattack.com/smf/index.php?topic=564.0). You can find
the [original README here](ReadMe.txt) for reference.
I have basically done a complete rewrite the original source code at this point
and added a lot of features including automatic detection of the correct
bindings file and support for non-US keyboard layouts (see below for details).
## Installing
Grab `bindEDplugin.zip` from the [release
page](https://github.com/alterNERDtive/bindED/releases/latest) and extract it
into your VoiceAttacks `Apps` directory. If you have an older version already
installed, please delete the `bindED` subfolder first.
For Horizons players, thats it! When VoiceAttack loads, bindED will
automatically detect your bindings. It will also keep a watchful eye on Elites
bindings folder and reload them when there is a change!
For Odyssey players, there is an additional caveat: you have to use the same
preset for all 4 sections (general, ship, SRV, foot). Sadly its not apparent
from the files which of these sections a bind belongs to, so there is no simple
way to read multiple files properly.
## Using Binds In Commands
Each bind in Elite Dangerous has a name assigned in the binds file. The plugin
takes this name, prepends `ed` and turns it into a VoiceAttack variable.
To press the corresponding key in the game, you will have to create a new
`Key Press` action in a VoiceAttack command and use the desired variable named
after the ingame bind. In order to toggle your landing gear for example you will
have to create a `Key Press` action and use the `edLandingGearToggle` variable.
![[keypress.png]]
Instead of looking through a binds file to find variable names, you can also
import and run the `bindED-reports` profile from the plugin directory. It will
put a) a list of all binds and b) a list of all missing binds on your Desktop.
Currently these lists will include _all_ binds, including axes that cannot be
bound to the keyboard.
## Supported Keyboard Layouts
If you are using any non-US layout you might have noticed that some binds dont
work. You can set a text variable in VoiceAttack called `bindED.layout#` to the
layout you want to use. If the variable is not set it will defaut to `en-us`.
This default should work for most™ keys on any keyboard layout natively
supported by Elite Dangerous; some special keys might not be usable.
The following layouts are _fully_ supported out of the box:
* en-US
* en-GB
* de-neo2
If you are on a different layout, you can either use only the keys that work
with the default layout or add support for your preferred layout yourself. See
[[Troubleshooting#Adding a Keyboard Layout]].
## Need Help / Want to Contribute?
If you run into any errors have a look at [[Troubleshooting]]. If your problem
persists, please [file an
issue](https://github.com/alterNERDtive/bindED/issues/new). Thanks! :)
You can also [say “Hi” on Discord](https://discord.gg/YeXh2s5UC6) if that is
your thing.
[![GitHub Sponsors](https://img.shields.io/github/sponsors/alterNERDtive?style=for-the-badge)](https://github.com/sponsors/alterNERDtive)
[![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/S6S1DLYBS)

121
docs/troubleshooting.md Normal file
View file

@ -0,0 +1,121 @@
# Troubleshooting
## Diagnosing Plugin Issues
If something goes awry you can manually call the `loadbinds` plugin context or
restart VoiceAttack to force a refresh.
If that doesnt help and your problems persist the first step should be to
import and load the included `bindED-diagnostics` profile from the plugin
directory. It will output the current plugin state (keyboard layout, preset and
binds file used) to the VoiceAttack log. You should also include the output of
that if you file an issue or ask for help on Discord.
If that seems correct, theres the `bindED-reports` profile. It will generate
both a list of bind names used by Elite and a report of binds that do not have a
keyboard shortcut assigned, and put them on your Desktop. Note that those lists
are currently not filtered in any way and will contain _all_ binds regardless if
they are used in any profiles or if they can even have a keyboard key assigned
(e.g. axes).
## Migrating from the Old Plugin
If you use this as a drop-in replacement for the initial version of bindED made
by Gary all commands invoking the plugin will throw an error message. Gary has
asked me to change the plugins GUID, and the plugin with the old one will no
longer be found. _That is irrelevant in basically all cases and can safely be
ignored_.
Binds will be read automatically when VoiceAttack starts and whenever they
change. To get rid of the error message(s) remove the outdated plugin
invocation(s) from your commands.
## Make Sure You Actually Have Binds Files
Before starting VoiceAttack with the plugin installed, you need to load the game
at least once! That will create the directory structure the plugin is going to
read from. You also need to have changed _any_ key in controls options.
If you start Elite for the first time with VoiceAttack already running you will
have to either invoke the plugins `loadbinds` config manually or restart
VoiceAttack after you have loaded into the games main menu and changed any key
bind.
## Horizons (legacy) vs. Odyssey (live)
Horizons support has been dropped. If you still play legacy, you will have to
use bindED <5.0.
## Specifying a Binds File to Load
You can set the text variable `~bindsFile` to a specific file name (e.g.
`custom.3.0.binds`) before executing the `loadbinds` context to have that
specific binds file loaded.
Make sure to only use the _file name_ of an existing binds file, do _not_
specify the full path.
This should be a last resort effort for when the game introduces changes that
break the plugins auto detection.
## Adding a Keyboard Layout
If you are using any non-US layout you might have noticed that some binds dont
work. The game itself supports a certain range of “standard” keyboard layouts
and falls back to UK QWERTY if you are using something else. The original plugin
was made for the US keyboard layout. So if you are using a layout that is not
natively supported by Elite and/or that has keys that dont exist on the US
layout, some keys will not work out of the box, e.g.:
* “VoiceAttack presses `p` but the game thinks its `v`!” (layout not natively
supported by Elite)
* “VoiceAttack presses `ß` but nothing happens!” (key not in the US key map)
I have included a map file for [Neo2](https://neo-layout.org)
(`EDMap-de-neo2.txt`) which is the layout that I am using personally and
A.Cyprus was kind enough to provide full support for en-GB. If you are on a
different layout, you will have to create a corresponding map file yourself. But
if you do Ill be happy to include it in future releases!
To add support for a new keyboard layout, you will have to create the
corresponding `EDMap-<id>.txt` file. Start by copying `EDMap-en-us.txt` in the
plugin directory and renaming it appropriately. The file contains a list of
`sym:code` pairs, one per line. The `sym` part is exactly like it is listed in
Elites `.binds` files, the `code` is the corresponding keycode VoiceAttack is
going to send.
You will have to go through the entire list and replace the existing `code`s
with the right ones for your layout. In order to do so I recommend following
these steps:
1. Open a reference for the UK QWERTY layout, [e.g. Wikipedias
image](https://en.wikipedia.org/wiki/QWERTY#/media/File:KB_United_Kingdom.svg).
1. Get a tool that can display keycodes for keys you press, [e.g. NirSofts
KeyboardStateView](https://www.nirsoft.net/utils/keyboard_state_view.html).
Or anything else that does it. Make sure it shows you _decimal_ keycodes
instead of (only) hex!
1. Make sure your PC is actually set to the layout you want to add.
1. Go through the file one by one.
1. Take note of its position on the keyboard. In this example we are using
the one in the top left next to `1` and my layout Neo2.
1. Find the correct key on the UK reference, for this example “Key_Grave”.
1. Press the corresponding key on your keyboard and observe the keycode it
produces. For Neo2 that was 186.
1. Change the `code` in the line to the correct keycode. For Neo2 the line
reads “Key_Grave:186”.
1. Repeat for the next line.
There are a bunch of symbols in the file that arent on a standard keyboard,
just ignore those. If you have extra keys that are not on the UK QWERTY layout,
youll have to go into the games controls options and try binding those keys.
If it works take the symbols they produce and go back to step 4 with them.
For the actual _letters_ youll have to assign the keycode of the key you are
pressing to the “Key_X” that is displayed ingame. So if the ingame controls
options say youve just pressed “H”, replace the “Key_H” line with the keycode
you get when you press the key you bound ingame. If the game assigns the letters
that are actually in that place on your layout, you wont have to do anything
for these.
Once you have tested and confirmed everything working, feel free to open a pull
request or issue and Ill include the new map!

26
mkdocs.yml Normal file
View file

@ -0,0 +1,26 @@
site_name: "bindED VoiceAttack plugin"
site_url: https://alterNERDtive.github.io/bindED
repo_url: https://github.com/alterNERDtive/bindED
edit_uri: "edit/devel/docs/"
site_description: "This VoiceAttack plugin reads keybindings in Elite:Dangerous and stores them as VoiceAttack variables."
site_author: "alterNERDtive"
remote_name: "origin"
theme:
name: readthedocs
prev_next_buttons_location: both
plugins:
- search
- roamlinks
markdown_extensions:
- toc:
permalink: True
- sane_lists
nav:
- 'index.md'
- 'troubleshooting.md'
- '⎋ Changelog': 'https://github.com/alterNERDtive/bindED/blob/release/CHANGELOG.md'
- '⎋ Report a Bug': 'https://github.com/alterNERDtive/bindED/issues/'

1
requirements.txt Normal file
View file

@ -0,0 +1 @@
mkdocs-roamlinks-plugin

16
stylecop.json Normal file
View file

@ -0,0 +1,16 @@
{
"$schema": "https://raw.githubusercontent.com/DotNetAnalyzers/StyleCopAnalyzers/master/StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json",
"settings": {
"orderingRules": {
"usingDirectivesPlacement": "outsideNamespace"
},
"documentationRules": {
"companyName": "alterNERDtive",
"copyrightText": "Copyright {year} {companyName}.\n\nThis file is part of {application}.\n\n{application} is free software: you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\n{application} is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with {application}. If not, see <https://www.gnu.org/licenses/>.",
"variables": {
"application": "bindED VoiceAttack plugin",
"year": "20202022"
}
}
}
}