Skip to content

Commit 9d855a4

Browse files
committed
added sendText
Minimal support per SDK: (TEXT_TYPE_PRINT_color) Simple text works, (TEXT_TYPE_SCROLLING_color) scrolling gives simple text, (TEXT_TYPE_MENU) menu gives no error-no response. (_color) color is ignored
1 parent 8cce917 commit 9d855a4

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

SimConnect/SimConnect.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -440,3 +440,16 @@ def flight_to_dic(self, fpath):
440440
temp = line.split("=")
441441
dic[index][temp[0]] = temp[1].strip()
442442
return dic
443+
444+
def sendText(self, text, timeSeconds=5, TEXT_TYPE=SIMCONNECT_TEXT_TYPE.SIMCONNECT_TEXT_TYPE_PRINT_WHITE):
445+
pyarr = bytearray(text.encode())
446+
dataarray = (ctypes.c_char * len(pyarr))(*pyarr)
447+
pObjData = cast(dataarray, c_void_p)
448+
self.dll.Text(
449+
self.hSimConnect,
450+
TEXT_TYPE,
451+
timeSeconds,
452+
0,
453+
sizeof(ctypes.c_double) * len(pyarr),
454+
pObjData
455+
)

SimConnect/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def int_or_str(value):
1111
return value
1212

1313

14-
__version__ = "0.4.20"
14+
__version__ = "0.4.21"
1515
VERSION = tuple(map(int_or_str, __version__.split(".")))
1616

1717
__all__ = ["SimConnect", "Request", "Event", "millis", "DWORD", "AircraftRequests", "AircraftEvents", "FacilitiesRequests"]

0 commit comments

Comments
 (0)