0

I need a function that returns the name of a key directly from the keyboard, eg, the input of '32' would return 'Space'.

I know there is a function that does this, but I can't figure out which one.

Edited by MajesticMoose: n/a

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by gerard4143
0

Nope, not as far as I know, you will just have to create a function to return the right values, this could be a start:

string getValueName(char vk) {
  string name;

  if ( vk >= '0' && vk <= '9' ) {
    name.push_back( vk );
    return name;
  }

  switch ( vk ) {
    case VK_SPACE:  return "Space";
    case VK_SHIFT:  return "Shift";
    // ... more cases
  }

  return "";
}

Edited by William Hemsworth: n/a

0

I need a function that returns the name of a key directly from the keyboard, eg, the input of '32' would return 'Space'.

I know there is a function that does this, but I can't figure out which one.

I know this is knit picking but....You can't get the name of the key "directly" from the keyboard, its generally via the operating system's kernel....I know knit picking

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.