Author Topic: OpenBVE & SDL 2 - scancodes vs keycodes  (Read 1932 times)

linuxtardis

  • Freshman

  • Offline
  • *

  • 1
  • Karma:
    +0/-0
    • View Profile
OpenBVE & SDL 2 - scancodes vs keycodes
« on: August 17, 2015, 06:39:16 AM »
Hi everyone, I am porting OpenBVE to SDL2 (for input & windowing) and OpenTK (for OpenGL/AL binding) and I hit a problem - is it better for this program to use scancodes (physical keys) or keycodes (mapped keys according to keyboard layout)?
If anyone is interested, here's (slightly outdated) github repo: https://github.com/JakubVanek/openbve, but beware, a lot of things isn't working yet.
Thanks
EDIT: one more question for previous OpenBVE devs: why are there logical operators often used instead of conditional ones in ifs?
« Last Edit: August 17, 2015, 06:53:38 AM by linuxtardis »

coneyislandDFNQ

  • Senior Administrator
  • Freshman

  • Offline
  • *****

  • 15
  • Karma:
    +0/-0
  • Personal Text
    Site Admin and Co-Founder {Developer}
    • View Profile
Re: OpenBVE & SDL 2 - scancodes vs keycodes
« Reply #1 on: August 17, 2015, 12:06:01 PM »
Hey,

Some of these technical questions some of us don't understand. I believe on the OpenBVE main site ran by user odakyufan can explain alot more.

The mapped keys I guess were easier to code in than other methods. Hopefully in the future the program use more of the computer graphics resources rather the program within itself.