US vs UK Keyboard - page 2

 
honest_knave:

It is an option, but there are a few other countries using GMT too.

You could code multiple keys to get the desired effect?

The other countries that use GMT all have quite different keyboards from UK keyboards, so they may want to remap anyway

If I can get the defaults correct for US / UK then I will cover a significant proportion of our user base

 
James Cater:

The other countries that use GMT all have quite different keyboards from UK keyboards, so they may want to remap anyway

True. This is none of my business but I can't help but think it would be frustrating if the EA incorrectly identifies my keyboard layout (for whatever reason) and I can't override it without making system-wide changes.

As a personal preference, I'm still leaning this way:

 

 

For what it is worth, my experience with IT equipment overseas is that you get a complete mix of keyboard styles, even within the same country.

 
honest_knave:

True. This is none of my business but I can't help but think it would be frustrating if the EA incorrectly identifies my keyboard layout (for whatever reason) and I can't override it without making system-wide changes.

As a personal preference, I'm still leaning this way:

 

 

For what it is worth, my experience with IT equipment overseas is that you get a complete mix of keyboard styles, even within the same country.

Agreed, need config options to force your choice. Also need to be able to change the keyboard map itself for all actions

In this case the default "Auto" option will guess using local GMT offset, but you have the choice to fix to US or UK as well

 
James Cater:

In this case the default "Auto" option will guess using local GMT offset, but you have the choice to fix to US or UK as well

Perhaps include TERMINAL_LANGUAGE with GMT offset for a more robust auto-selection? It may help eliminate non-UK but GMT countries.
 
honest_knave:
Perhaps include TERMINAL_LANGUAGE with GMT offset for a more robust auto-selection? It may help eliminate non-UK but GMT countries.
Yes, nice
 

#property strict
#property indicator_chart_window

enum KeyboardEnum
{
   KEYBOARD_AUTO = 0,    // Auto
   KEYBOARD_US = 1,      // US Keyboard
   KEYBOARD_UK = 2,      // UK Keyboard
};

extern string          HotKeysMapUS = "hcrnmlvjktyb./907'";   // Hot Keys Map (US Keyboard)
extern string          HotKeysMapUK = "hcrnmlvjktyb./907`";   // Hot Keys Map (UK Keyboard)
extern KeyboardEnum    HotKeysKeyboard = KEYBOARD_AUTO;       // Hot Keys Keyboard

string ExtHotKeysMap;

int OnInit()
{
   ExtHotKeysMap =
      HotKeysKeyboard == KEYBOARD_UK || (HotKeysKeyboard == KEYBOARD_AUTO && MathAbs(TimeGMTOffset()) <= 3600 && TerminalInfoString(TERMINAL_LANGUAGE) == "English")
         ? HotKeysMapUK
         : HotKeysMapUS;

   return INIT_SUCCEEDED;
}

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
{
   return rates_total;
}

void OnChartEvent(const int inId, const long &inLparam, const double &dparam, const string &sparam)
{
   // Use ExtHotKeysMap here
}
 
James Cater:

It's just a consistent "user interface".

There is a reason why the escape key is top left on all keyboards, it's because if you want to escape form an operation the reflex is to swipe away from the operation and not go hunting for the next "action". Hence if a dialog pops up you can dismiss it with the same muscle memory on every keyboard.

The same applies to the "WASD" keys that games use to control movement. They were chosen because they map well to the left hand whist the right hand controls the mouse to "look around"  the scene. If your WASD keys were on the right hand side of the keyboard then this would not be as convenient (anyone remember holding your left arm across your chest to reach the arrow keys?)

So having a significant action in the same place on the keyboard does have a "precedent" in many areas of product design.

There are also dozens of "conflicting" interfaces from different products that have been made consistent over the years. So it's not "weird" to want a consistent interface for all your users.

http://www.pcgamer.com/how-wasd-became-the-standard-pc-control-scheme/
Thanks for these explanation. Interesting.

James Cater:

#property strict
#property indicator_chart_window

enum KeyboardEnum
{
   KEYBOARD_AUTO = 0,    // Auto
   KEYBOARD_US = 1,      // US Keyboard
   KEYBOARD_UK = 2,      // UK Keyboard
};

extern string          HotKeysMapUS = "hcrnmlvjktyb./907'";   // Hot Keys Map (US Keyboard)
extern string          HotKeysMapUK = "hcrnmlvjktyb./907`";   // Hot Keys Map (UK Keyboard)
extern KeyboardEnum    HotKeysKeyboard = KEYBOARD_AUTO;       // Hot Keys Keyboard

string ExtHotKeysMap;

int OnInit()
{
   ExtHotKeysMap =
      HotKeysKeyboard == KEYBOARD_UK || (HotKeysKeyboard == KEYBOARD_AUTO && MathAbs(TimeGMTOffset()) <= 3600 && TerminalInfoString(TERMINAL_LANGUAGE) == "English")
         ? HotKeysMapUK
         : HotKeysMapUS;

   return INIT_SUCCEEDED;
}

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
{
   return rates_total;
}

void OnChartEvent(const int inId, const long &inLparam, const double &dparam, const string &sparam)
{
   // Use ExtHotKeysMap here
}
I would like it for my French (Belgian) keyboard please.
 
Alain Verleyen:
Thanks for these explanation. Interesting.

I would like it for my French (Belgian) keyboard please.

#property strict
#property indicator_chart_window

enum KeyboardEnum
{
   KEYBOARD_AUTO = 0,    // Auto
   KEYBOARD_US = 1,      // English US
   KEYBOARD_UK = 2,      // English UK
   KEYBOARD_OTHER = 3,   // Other
};

extern string          HotKeysMapEngUS = "hcrnmlvjktyb./907'";    // Hot Keys Map (English US)
extern string          HotKeysMapEngUK = "hcrnmlvjktyb./907`";    // Hot Keys Map (English UK)
extern string          HotKeysMapOther = "hcrnmlvjktyb./907`";    // Hot Keys Map (Other)
extern KeyboardEnum    HotKeysKeyboard = KEYBOARD_AUTO;           // Hot Keys Keyboard

string ExtHotKeysMap;

int OnInit()
{
   switch(HotKeysKeyboard)
   {
      case KEYBOARD_US:    ExtHotKeysMap = HotKeysMapEngUS; break;
      case KEYBOARD_UK:    ExtHotKeysMap = HotKeysMapEngUK; break;
      case KEYBOARD_OTHER: ExtHotKeysMap = HotKeysMapOther; break;
      default:
         ExtHotKeysMap =
            TerminalInfoString(TERMINAL_LANGUAGE) == "English"
               ? (MathAbs(TimeGMTOffset()) <= 3600 ? HotKeysMapEngUK : HotKeysMapEngUS)
               : HotKeysMapOther;
         break;
   }
   return INIT_SUCCEEDED;
}

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
{
   return rates_total;
}

void OnChartEvent(const int inId, const long &inLparam, const double &dparam, const string &sparam)
{
   // Use ExtHotKeysMap here
}

There you go. A little less biased towards the English language keyboards :)

 
James Cater:

Does anyone know if there is a way to detect the keyboard or current language settings without using DLL calls ?