Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remake keybinding ui and add mouse support #638

Merged
merged 3 commits into from
May 17, 2017
Merged

Conversation

commy2
Copy link
Contributor

@commy2 commy2 commented Apr 12, 2017

When merged this pull request will:

http://i.imgur.com/OCL4Z2a.jpg
Also has all the features the vanilla keybinding ui has. Undo, Delete, Default, Next, Prev and they all do exactly the same.

@commy2 commy2 self-assigned this Apr 12, 2017
@commy2 commy2 added this to the 3.4 milestone Apr 15, 2017
@commy2
Copy link
Contributor Author

commy2 commented Apr 15, 2017

[
    "Test Category",
    "Test",
    ["key action name", "key action tooltip"],
        {systemChat str 1},
        {systemChat str 2},
    [15, [false, false, false]]
] call cba_fnc_addKeybind;

@commy2 commy2 changed the base branch from master to mouse-support-localization April 23, 2017 04:35
@commy2 commy2 changed the title improve keybinding ui remake keybinding ui and add mouse support Apr 23, 2017
@commy2
Copy link
Contributor Author

commy2 commented Apr 23, 2017

note:

  • split tweaks needed for CBA_fnc_addKeybind from this to keep PR small...
  • same for settings ui tweaks (copy pasted tweaks from this)?
  • fix: using CBA_fnc_addKeyHandler twice on the same hashkey bugs out CBA_fnc_removeKeyHandler

// data for controls menu
if (isNil QGVAR(actions)) then {
GVAR(actions) = [] call CBA_fnc_createNamespace;
//GVAR(keys) = [] call CBA_fnc_createNamespace;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it's all still experimental and wip.

@commy2
Copy link
Contributor Author

commy2 commented Apr 24, 2017

Part of this went into #656, so this PR can eventually only change the gui and not CBA_fnc_addKeybind.

@commy2 commy2 changed the base branch from mouse-support-localization to keybinding May 1, 2017 08:00
@commy2 commy2 removed the WIP label May 9, 2017
@commy2
Copy link
Contributor Author

commy2 commented May 9, 2017

done

@PabstMirror
Copy link
Contributor

ACE uses -1 for some unbound keys

["Pabst", "test2", "test2",{systemChat "test2";}, {}, [-1, [false, false, false]], false] call CBA_fnc_addKeybind;

throws

Error position: <set [_key, _hashKeys];
  Error Zero divisor
File \x\cba\addons\events\fnc_addKeyHandler.sqf [CBA_fnc_addKeyHandler], line 2014

@@ -92,6 +92,8 @@ if (_defaultKeybind isEqualTypeParams [0, false, false, false]) then {
_defaultKeybind params [["_defaultKey", 0, [0]], ["_defaultModifiers", [], [[]]]];
_defaultModifiers params [["_defaultShift", false, [false]], ["_defaultControl", false, [false]], ["_defaultAlt", false, [false]]];

_defaultKey = _defaultKey max 0;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about big numbers?
min 254?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why would anyone use these?

[0xF8, 0x100004], // Mouse wheel up
[0xF9, 0x100005], // Mouse wheel down
[84, DIK_SYSRQ],
[198, DIK_PAUSE]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alt+Print and Ctrl+Pause leads to UNEXPECTED_KEY, even in vanilla, but this makes them display the right key.

@commy2 commy2 force-pushed the improve-keybinding-ui branch 2 times, most recently from 9b6dc1a to c48c26d Compare May 11, 2017 19:47
@commy2 commy2 changed the base branch from keybinding to localizeKey May 11, 2017 19:47
@commy2 commy2 changed the base branch from localizeKey to keybinding-cfgFunctions-macros May 11, 2017 19:48
@commy2 commy2 changed the base branch from keybinding-cfgFunctions-macros to keybinding May 13, 2017 10:32
@commy2 commy2 merged commit 648db8c into keybinding May 17, 2017
@commy2 commy2 deleted the improve-keybinding-ui branch May 17, 2017 16:59
commy2 added a commit that referenced this pull request May 20, 2017
* Mouse support for CBA_fnc_addKeyHandler  (#651)

* use last possible single key as array size

* delete superfluous check, fix header

* roll less, but bigger numbers to generate random hashkey

* header formatting

* only compile functions on machines with interface

* add mission display ui events directly on display init

* rename display load functions for naming conventions

* prepare mouse handers in zeus display

* fix issues with blocking key events

* isEqualTo for maximum performance :S

* fix no return value making blocking undefined

* simplify

* better variable name

* remove a superfluous check

* add a comment to seperate key handler code from other stuff

* add support for mouse keys and the scroll wheel

* add mouse button translations (#652)

* add mouse button translations to custom dik codes

* fix keyHandler becoming unremovable if added to two different keys (#653)

* fix keyHandler becoming unremovable if added two different keys

* fix strange modifier key behavior (#654)

* fix strange modifier key behaviour

* disable modifier state in keyDown if released

* squash-CBA_fnc_addKeybind-redo (#656)

* fix a script error

* add function to translate keys

* joinString

* fix rebinding would delete default keyup handler

* CfgFunctions

* display multiple keybinds in diary

* fix for travis

* remake keybinding ui and add mouse support (#638)

* remake rebinding ui for mouse support

* remember last selected addon in keybinding ui
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants