Giter Site home page Giter Site logo

Comments (4)

binary1248 avatar binary1248 commented on May 27, 2024

So this is the mapping of scan codes GetKeyNameText dumps on my system:

0x1 -> Esc
0x2 -> 1
0x3 -> 2
0x4 -> 3
0x5 -> 4
0x6 -> 5
0x7 -> 6
0x8 -> 7
0x9 -> 8
0xa -> 9
0xb -> 0
0xc -> -
0xd -> =
0xe -> Backspace
0xf -> Tab
0x10 -> Q
0x11 -> W
0x12 -> E
0x13 -> R
0x14 -> T
0x15 -> Y
0x16 -> U
0x17 -> I
0x18 -> O
0x19 -> P
0x1a -> [
0x1b -> ]
0x1c -> Enter
0x1d -> Ctrl
0x1e -> A
0x1f -> S
0x20 -> D
0x21 -> F
0x22 -> G
0x23 -> H
0x24 -> J
0x25 -> K
0x26 -> L
0x27 -> ;
0x28 -> '
0x29 -> `
0x2a -> Shift
0x2b -> \
0x2c -> Z
0x2d -> X
0x2e -> C
0x2f -> V
0x30 -> B
0x31 -> N
0x32 -> M
0x33 -> ,
0x34 -> .
0x35 -> /
0x36 -> Right Shift
0x37 -> Num *
0x38 -> Alt
0x39 -> Space
0x3a -> Caps Lock
0x3b -> F1
0x3c -> F2
0x3d -> F3
0x3e -> F4
0x3f -> F5
0x40 -> F6
0x41 -> F7
0x42 -> F8
0x43 -> F9
0x44 -> F10
0x45 -> Pause
0x46 -> Scroll Lock
0x47 -> Num 7
0x48 -> Num 8
0x49 -> Num 9
0x4a -> Num -
0x4b -> Num 4
0x4c -> Num 5
0x4d -> Num 6
0x4e -> Num +
0x4f -> Num 1
0x50 -> Num 2
0x51 -> Num 3
0x52 -> Num 0
0x53 -> Num Del
0x54 -> Sys Req
0x56 -> \
0x57 -> F11
0x58 -> F12
0x7c -> F13
0x7d -> F14
0x7e -> F15
0x7f -> F16
0x80 -> F17
0x81 -> F18
0x82 -> F19
0x83 -> F20
0x84 -> F21
0x85 -> F22
0x86 -> F23
0x87 -> F24

0x7c to 0x87 just happen to be the VK_F13 to VK_F24 values.

There are 2 possibilities... Either the Windows developers screwed up and unintentionally mixed up scan codes and virtual key codes, or for some reason this was deliberate but undocumented. Either way, it is highly unlikely this will be changed/fixed any time soon on the Windows end, so we would have to remap 0x64-0x76 to 0x7c-0x87 before sending them to GetKeyNameText.

from sfml.

binary1248 avatar binary1248 commented on May 27, 2024

Should be fixed with #2873.

from sfml.

ChrisThrasher avatar ChrisThrasher commented on May 27, 2024

Just fixed this in v3 (master branch). I think we'll patch this in v2 as well at a later time.

from sfml.

pierr3 avatar pierr3 commented on May 27, 2024

Thank you for the quick fix!

from sfml.

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.