Git Product home page Git Product logo

Comments (4)

Killswitch00 avatar Killswitch00 commented on September 23, 2024

Something like this could possibly be done using CBA_fnc_getKeybind:

_entry = ["RQ-11B Raven Addon", "Altitude Raise"] call CBA_fnc_getKeybind;

if (!isNil "_entry") then {
  _keyBind = _entry select 5;   // [17, [false, false, false]]
  _dikCode = _keystroke select 0  // 17
  _keyStr = cba_keybinding_dikDecToStringTable select (_dikCode + 1) // ["17", "W"]

  ...
  ...
};
FEINT_fnc_revealKeybind = {
    private "_entry";

    _entry = _this call CBA_fnc_getKeybind;
    if (isNil "_entry") then { nil } else { _entry select 5 };
};

from cba_a3.

ViperMaul avatar ViperMaul commented on September 23, 2024

@jaynus
Checking status on this.
How does killswitch's response work for you?

from cba_a3.

Killswitch00 avatar Killswitch00 commented on September 23, 2024

It's "feint" who had the issue and jaynus copied it here from the one at Dev-Heaven

With no feedback from feint here or at DH, we have no idea of the status. Hopefully, feint has been able to implement a "reveal keybind" function with the tips I provided.

from cba_a3.

jonnyfilmboy avatar jonnyfilmboy commented on September 23, 2024

Hey, this is Feint (Feint username is taken). Sorry for the delay in my feedback. This is working great for me. I set up the following code to display the key in my Raven 3.0 addon that's coming out soon.

findCBAKeyAssignments = {
  private ["_addonToSearchFor","_keyToSearchFor","_keyConfig","_prettyKeyName","_shiftState","_ctrlState","_altState","_assignedKey","_keyResults"];
  _addonToSearchFor = _this select 0;
  _keyToSearchFor = _this select 1;

  _keyConfig = [_addonToSearchFor,_keyToSearchFor] call cba_fnc_getKeybind;
  _prettyKeyName = _keyConfig select 2;
  _shiftState = _keyConfig select 5 select 1 select 0;
  _ctrlState = _keyConfig select 5 select 1 select 1;
  _altState = _keyConfig select 5 select 1 select 2;
  _assignedKey = keyName (_keyConfig select 5 select 0);

  if (_shiftState) then {_shiftState = "Shift"} else {_shiftState = ""};
  if (_ctrlState) then {_ctrlState = "Ctrl"} else {_ctrlState = ""};
  if (_altState) then {_altState = "Alt"} else {_altState = ""};

  _keyResults = [_prettyKeyName,_shiftState,_ctrlState,_altState,_assignedKey];
  _keyResults
};

Example:

_testResults = ["RQ-11B Raven Addon","Altitude_Raise"] call MAV_fnc_findCBAKeyAssignments;
_instructions = format ["%1 = %2%3%4 %5",_testResults select 0,_testResults select 1,_testResults select 2,_testResults select 3,_testResults select 4];
(_dspl displayCtrl 2020667) ctrlSetStructuredText parseText _instructions;

Result:
"Altitude Raise" = "W"

Thanks for adding this to your fine code. It really helps.

from cba_a3.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.