Skip to content

Commit

Permalink
Virtual keyboard & touch fix
Browse files Browse the repository at this point in the history
  • Loading branch information
hugeBlack committed Oct 10, 2024
1 parent f58a1eb commit 98361c9
Show file tree
Hide file tree
Showing 8 changed files with 431 additions and 137 deletions.
4 changes: 0 additions & 4 deletions OpenParsec.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
27A267352B1AEAB700F34C63 /* SettingsHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27A267342B1AEAB700F34C63 /* SettingsHandler.swift */; };
27A923E029E8E53000F54BDA /* TouchHandlingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27A923DF29E8E53000F54BDA /* TouchHandlingView.swift */; };
27A923E229E8FEE900F54BDA /* UIViewControllerWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27A923E129E8FEE900F54BDA /* UIViewControllerWrapper.swift */; };
27A923E429E9035D00F54BDA /* KeyboardViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27A923E329E9035D00F54BDA /* KeyboardViewController.swift */; };
27AC751829EA339B00E8CAF7 /* URLImage.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27AC751729EA339B00E8CAF7 /* URLImage.swift */; };
27AD36602B19731800C8A607 /* ExUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27AD365F2B19731800C8A607 /* ExUI.swift */; };
27B23A222B1B979C00B52F14 /* ParsecMetalRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B23A212B1B979C00B52F14 /* ParsecMetalRenderer.swift */; };
Expand Down Expand Up @@ -72,7 +71,6 @@
27A267342B1AEAB700F34C63 /* SettingsHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SettingsHandler.swift; sourceTree = "<group>"; };
27A923DF29E8E53000F54BDA /* TouchHandlingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TouchHandlingView.swift; sourceTree = "<group>"; };
27A923E129E8FEE900F54BDA /* UIViewControllerWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIViewControllerWrapper.swift; sourceTree = "<group>"; };
27A923E329E9035D00F54BDA /* KeyboardViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = KeyboardViewController.swift; sourceTree = "<group>"; };
27AC751729EA339B00E8CAF7 /* URLImage.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLImage.swift; sourceTree = "<group>"; };
27AD365F2B19731800C8A607 /* ExUI.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExUI.swift; sourceTree = "<group>"; };
27B23A212B1B979C00B52F14 /* ParsecMetalRenderer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParsecMetalRenderer.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -148,7 +146,6 @@
84480EBD2ADC4FDA007DE5F1 /* GameController.swift */,
27E61A9F292965FD00FF6563 /* Info.plist */,
17EEB91B2BEE62BA00502A3A /* KeyBoardTest.swift */,
27A923E329E9035D00F54BDA /* KeyboardViewController.swift */,
27E61A9C292965FD00FF6563 /* LaunchScreen.storyboard */,
27E61AA52929817700FF6563 /* LoginView.swift */,
27E61AA92929B92200FF6563 /* MainView.swift */,
Expand Down Expand Up @@ -270,7 +267,6 @@
17CD1E032BF07BC3003D2102 /* ViewContainerPatch.swift in Sources */,
27E61AA8292994B500FF6563 /* ActivityIndicator.swift in Sources */,
271D14FC292EAA3600D7F1D6 /* ParsecGLKRenderer.swift in Sources */,
27A923E429E9035D00F54BDA /* KeyboardViewController.swift in Sources */,
27E61A94292965FC00FF6563 /* SceneDelegate.swift in Sources */,
27A267352B1AEAB700F34C63 /* SettingsHandler.swift in Sources */,
27AD36602B19731800C8A607 /* ExUI.swift in Sources */,
Expand Down
14 changes: 12 additions & 2 deletions OpenParsec/CParsec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ protocol ParsecService {
func sendMouseDelta(_ dx: Int32, _ dy: Int32)
func sendMousePosition(_ x: Int32, _ y: Int32)
func sendKeyboardMessage(event: KeyBoardKeyEvent)
func sendVirtualKeyboardInput(text: String)
func sendVirtualKeyboardInput(text: String, isOn: Bool)
func sendGameControllerButtonMessage(controllerId: UInt32, _ button: ParsecGamepadButton, pressed: Bool)
func sendGameControllerAxisMessage(controllerId: UInt32, _ button: ParsecGamepadAxis, _ value: Int16)
func sendGameControllerUnplugMessage(controllerId: UInt32)
Expand Down Expand Up @@ -128,8 +130,8 @@ class CParsec
{
parsecImpl.setFrame(width, height, scale)
// set client resolution
ParsecResolution.resolutions[1].width = Int(width)
ParsecResolution.resolutions[1].height = Int(height)
ParsecResolution.resolutions[1].width = Int(width * scale)
ParsecResolution.resolutions[1].height = Int(height * scale)

}

Expand Down Expand Up @@ -171,6 +173,14 @@ class CParsec
parsecImpl.sendKeyboardMessage(event: event)
}

static func sendVirtualKeyboardInput(text: String) {
parsecImpl.sendVirtualKeyboardInput(text: text)
}

static func sendVirtualKeyboardInput(text: String, isOn: Bool) {
parsecImpl.sendVirtualKeyboardInput(text: text, isOn: isOn)
}

static func sendGameControllerButtonMessage(controllerId:UInt32, _ button:ParsecGamepadButton, pressed:Bool)
{
parsecImpl.sendGameControllerButtonMessage(controllerId: controllerId, button, pressed: pressed)
Expand Down
63 changes: 0 additions & 63 deletions OpenParsec/KeyboardViewController.swift

This file was deleted.

Loading

0 comments on commit 98361c9

Please sign in to comment.