lsteamclient: Convert windows VK to xkeysym

This commit is contained in:
Andrew Eikum 2019-06-17 10:50:11 -05:00
parent 1a2fd5fdbc
commit 5b674f087a
8 changed files with 165 additions and 1 deletions

View file

@ -181,6 +181,11 @@ manual_type_converters = [
"FSteamNetworkingSocketsDebugOutput"
]
# manual converters for specific parameters
manual_param_converters = [
"nNativeKeyCode"
]
#struct_conversion_cache = {
# '142': {
# 'SteamUGCDetails_t': True,
@ -540,6 +545,8 @@ def handle_method(cfile, classname, winclassname, cppname, method, cpp, cpp_h, e
win_name = typename.replace(real_type.spelling, "win%s_%s" % (real_type.spelling, sdkver))
elif real_type.spelling in manual_type_converters:
manual_convert.append(param)
elif param.spelling in manual_param_converters:
manual_convert.append(param)
if param.spelling == "":
cfile.write(", %s _%s" % (win_name, unnamed))
@ -587,7 +594,10 @@ def handle_method(cfile, classname, winclassname, cppname, method, cpp, cpp_h, e
cpp.write(" %s lin_%s;\n" % (param.type.spelling, param.spelling))
cpp.write(" win_to_lin_struct_%s_%s(&%s, &lin_%s);\n" % (param.type.spelling, sdkver, param.spelling, param.spelling))
for param in manual_convert:
cpp.write(" %s = (%s)manual_convert_%s((void*)%s);\n" % (param.spelling, param.type.spelling, param.type.spelling, param.spelling))
if param.spelling in manual_param_converters:
cpp.write(" %s = manual_convert_%s(%s);\n" % (param.spelling, param.spelling, param.spelling))
else:
cpp.write(" %s = (%s)manual_convert_%s((void*)%s);\n" % (param.spelling, param.type.spelling, param.type.spelling, param.spelling))
cfile.write(" TRACE(\"%p\\n\", _this);\n")