Re: HOT KEYS[message #330458] |
Sun, 09 February 2014 06:27   | |
sevenfm
|
 |
Messages:1822
Registered:December 2012 Location: Soviet Russia |
|
|
@Anthropoid
Having more options for sorting is good 
As for hotkeys, CTRL+D is already used for "disable player interrupts for that turn" feature.
We already have too much hotkeys, i would recommend instead make a dialog (call it using CTRL+'i', which will stand for "inventory manipulations").
There is a good 16 medium sized button dialog for that.
All you have to do is set text values, create callback function and call DoMessageBox(...)
Put all exisitng inventory-related actions there, and add yours.
As for coding, you can install VS2010, get svn source, and look at Tactical/Turn Based Input.cpp, search for any already implemented inventory manipulation hotkey ('f' for example) and that is your starting point 
Of course, that needs at least basic knowledge of c/cpp.
|

|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: HOT KEYS[message #333873] |
Tue, 24 June 2014 13:04   | |
Flugente
|
 |
Messages:3444
Registered:April 2009 Location: Germany |
|
|
nhja2fanHere's a solution:
1. Leave the bound hotkeys as they are, no changes, really (this is important, otherwise people will hate you).
2. Make them configurable via ini or xml.
3. Additions to hotkeys would be new functionality, exposed in the configuration file, but no new default bindings.
4. If new default bindings are to be added, wait say six months so people have had a chance to try out various things.
Not a fan, honestly. If hotkeys are definable, there'll soon be even more confusion, as other people cannot even answer which key would be right, because they don't know your configuration.
|

|
|
|
|
|
Re: HOT KEYS[message #333876] |
Tue, 24 June 2014 13:45   | |
nhja2fan
|
 |
Messages:27
Registered:March 2012 |
|
|
@Flugente
I prefer using the keyboard over mouse ui, or menus, but once there are too many keys, I tend to revert to the mouse for the lesser used ones.
Why I like the config file, is that it separates the UI events from the specific action used to activate it. Conceivably, you could integrate unusual input devices (10 button mice or whatnot). Also you could include events that aren't bound by default (for example, a single event that automatically performs a fully aimed shot with a single key, heck, you could chain together multiple ui events to a single key). The possibilities are endless, but I concede that explanation would be made more difficult. Anyway, it's just a suggestion.
Also, to blow your mind, how about voice commands.
@Sevenfm
I like the idea, particularly the menu (could tooltip the hotkey combo on the menu).
|
|
|
|
|
|
|
|
|
|
|
Re: HOT KEYS[message #341645 is a reply to message #341643] |
Thu, 09 July 2015 14:02   | |
Flugente
|
 |
Messages:3444
Registered:April 2009 Location: Germany |
|
|
Not technically difficult. However, we have an obscene amount of hotkeys in use, coded in many, many places. First you have to find all of them, then you have to list and describe all of them (in a proper way so you actually find and understand them), and then you have to always keep that description up-to-date. Tons of work, and has to be done by a coder. 
The optimal solution would be code change that restructures the entire key handling system. Basically, you'd use (pseudocode)
// enum of all actiosn that can be called via hotkey
enum HOTKEY_INVOKED_FUNCTIONS
{
CROUCH,
END_TURN,
AUTOBANDAGE,
...
// this goes on for a loooong time :-)
ACTION_MAX,
};
struct HOTKEY_STUFF
{
UINT16 actionused; // link to action from HOTKEY_INVOKED_FUNCTIONS
// special keys used
BOOLEAN fAlt;
BOOLEAN fCtrl;
BOOLEAN fShift;
// keys used (a-z, 0 -9 etc.)
UINT32 keyused;
// a flagmask describing where an action is used (tactical/strategic/inventory/laptop...)
};
// for each language:
STR16 actiondescription_short[ACTION_MAX]=
{
L"Crouch",
...
};
STR16 actiondescription_long[ACTION_MAX]=
{
L"The currently selected merc changes to crouch stance.",
...
};
// A giant function that handels hotkey input:
void HandleKeyPress(...)
{
...
evaluate key press, find matching HOTKEY_STUFF
call function referred to via actionused
...
}
The work required is obscene, but a benefit is that all hotkeys are grouped neatly together. All required after that is a neat table that can handle this.
At that point, it would also be trivial to print that table in a .txt file. Provided the coders simply keep the decriptions up-to-date (which is a lot easier now, as it's all in one clear-defined place, and coders love simply adding another entry to clearly-defined places), we have no more need for hotkey pdfs that always outdate fast. Push a button and the game generates it for you.
This could also be used to have those hotkeys be editable (save/load the hotkey list in a .txt file), it's even possible to edit ingame if one codes that. I would, however, advise strongly against this. Our glorious community would simply use this to redefine every keystroke in every mod differently, which is about as useful as a bullet to the head. Don't deny it, that's the kind of nonsense this community does
[Updated on: Thu, 09 July 2015 14:04]
You gotta wash your hands before picking up a baby. They can see the bacteria burning into their flesh.
If you want, you can donate to me. This will not affect how and what I code, and I will not code specific features in return. I will be thankful though.
|

|
|
|
|
|
|
|
|
|
Re: HOT KEYS[message #351730 is a reply to message #111297] |
Thu, 21 December 2017 15:45   | |
againagain
|
Messages:2
Registered:December 2017 |
|
|
Hello; is there a way to remap a 1.13 keyboard hotkey by manually delving into any of the files? Showing merc line of sight gets particularly cumbersome in the long run :<
|
|
|
|
|
|
Re: HOT KEYS[message #351748 is a reply to message #351732] |
Sat, 23 December 2017 13:15   | |
againagain
|
Messages:2
Registered:December 2017 |
|
|
sevenfm wrote on Thu, 21 December 2017 16:15You can also use external program to remap keys, for example I use Autohotkey to play older Ja2 versions and map End and Del keys to extra mouse keys, using simple script:
This is much better, simpler and flexiblerer that I ever hoped for; you, sir or madam, are a godsend.
EDIT: In case anyone else finds this same problem & solution, seems that it isn't even necessary to avoid the already allocated keys and combinations of JA2 in your AutoHotkey script. For example, you can assign the A key to do something else than its original auto-bandage, and still keep the ability to auto-bandage pressing for example Ctrl+A adding this:
[Updated on: Sun, 24 December 2017 12:38]
|
|
|
|
|
|