Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions OpenParsec/ParsecSDKBridge.swift
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,8 @@ class ParsecSDKBridge: ParsecService {
}
var keyboardMessagePress = ParsecMessage()
keyboardMessagePress.type = MESSAGE_KEYBOARD
if !isVirtualShiftOn && useShift {
let sendShift = !isVirtualShiftOn && useShift
if sendShift {
keyboardMessagePress.keyboard = ParsecKeyboardMessage(code: KEY_LSHIFT, mod: MOD_NONE, pressed: true, __pad: (0, 0, 0))
ParsecClientSendMessage(_parsec, &keyboardMessagePress)
}
Expand All @@ -452,10 +453,11 @@ class ParsecSDKBridge: ParsecService {
// add release delay in case some games ignore instant key release
DispatchQueue.global().asyncAfter(deadline: .now() + 0.02) {
keyboardMessagePress.keyboard = ParsecKeyboardMessage(code: keyCode, mod: MOD_NONE, pressed: false, __pad: (0, 0, 0))
if !self.isVirtualShiftOn && useShift {
ParsecClientSendMessage(self._parsec, &keyboardMessagePress)
if sendShift {
keyboardMessagePress.keyboard = ParsecKeyboardMessage(code: KEY_LSHIFT, mod: MOD_NONE, pressed: false, __pad: (0, 0, 0))
ParsecClientSendMessage(self._parsec, &keyboardMessagePress)
}
ParsecClientSendMessage(self._parsec, &keyboardMessagePress)
}
}

Expand Down
4 changes: 2 additions & 2 deletions OpenParsec/ParsecViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1161,7 +1161,7 @@ extension ParsecViewController: UIKeyInput, UITextInputTraits {

// Set the image and button properties
button.setTitle(displayText, for: .normal)
button.titleLabel?.font = UIFont(name: "System", size: 10.0)
button.titleLabel?.font = .systemFont(ofSize: 10)
button.frame = CGRect(x: 0, y: 0, width: 36, height: 36)
button.titleLabel?.frame = CGRect(x: 0, y: 0, width: 30, height: 30)
if let label = button.titleLabel {
Expand All @@ -1173,7 +1173,7 @@ extension ParsecViewController: UIKeyInput, UITextInputTraits {
button.titleLabel?.contentMode = .scaleAspectFit

// Set target and action for button
button.addTarget(target, action: #selector(toolbarButtonClicked(_:)), for: .touchUpInside)
button.addTarget(self, action: #selector(toolbarButtonClicked(_:)), for: .touchUpInside)

return button
}
Expand Down
Loading