feat: expose keyboard_layout through config (#448)

This commit is contained in:
Przemko Robakowski
2024-04-30 09:48:00 -04:00
committed by GitHub
parent 84a1b710d7
commit 35839459aa
6 changed files with 11 additions and 2 deletions
+1
View File
@@ -289,6 +289,7 @@ impl Config {
enable_credssp: !args.no_credssp,
keyboard_type: KeyboardType::parse(args.keyboard_type),
keyboard_subtype: args.keyboard_subtype,
keyboard_layout: 0, // the server SHOULD use the default active input locale identifier
keyboard_functional_keys_count: args.keyboard_functional_keys_count,
ime_file_name: args.ime_file_name,
dig_product_id: args.dig_product_id,
+1 -1
View File
@@ -630,7 +630,7 @@ fn create_gcc_blocks<'a>(
desktop_height: config.desktop_size.height,
color_depth: ColorDepth::Bpp8, // ignored because we use the optional core data below
sec_access_sequence: SecureAccessSequence::Del,
keyboard_layout: 0, // the server SHOULD use the default active input locale identifier
keyboard_layout: config.keyboard_layout,
client_build: config.client_build,
client_name: config.client_name.clone(),
keyboard_type: config.keyboard_type,
+1
View File
@@ -133,6 +133,7 @@ pub struct Config {
pub keyboard_type: gcc::KeyboardType,
pub keyboard_subtype: u32,
pub keyboard_functional_keys_count: u32,
pub keyboard_layout: u32,
pub ime_file_name: String,
pub bitmap: Option<BitmapConfig>,
pub dig_product_id: String,
+1
View File
@@ -777,6 +777,7 @@ fn build_config(
enable_credssp: true,
keyboard_type: ironrdp::pdu::gcc::KeyboardType::IbmEnhanced,
keyboard_subtype: 0,
keyboard_layout: 0, // the server SHOULD use the default active input locale identifier
keyboard_functional_keys_count: 12,
ime_file_name: String::new(),
dig_product_id: String::new(),
+1
View File
@@ -181,6 +181,7 @@ fn build_config(username: String, password: String, domain: Option<String>) -> c
enable_credssp: true,
keyboard_type: KeyboardType::IbmEnhanced,
keyboard_subtype: 0,
keyboard_layout: 0,
keyboard_functional_keys_count: 12,
ime_file_name: String::new(),
dig_product_id: String::new(),
+6 -1
View File
@@ -26,6 +26,7 @@ pub mod ffi {
pub enable_credssp: Option<bool>,
pub keyboard_type: Option<ironrdp::pdu::gcc::KeyboardType>,
pub keyboard_subtype: Option<u32>,
pub keyboard_layout: Option<u32>,
pub keyboard_functional_keys_count: Option<u32>,
pub ime_file_name: Option<String>,
pub dig_product_id: Option<String>,
@@ -89,6 +90,10 @@ pub mod ffi {
self.enable_credssp = Some(enable_credssp);
}
pub fn set_keyboard_layout(&mut self, keyboard_layout: u32) {
self.keyboard_layout = Some(keyboard_layout);
}
pub fn set_keyboard_type(&mut self, keyboard_type: KeyboardType) {
self.keyboard_type = Some(keyboard_type.into());
}
@@ -151,7 +156,7 @@ pub mod ffi {
domain: self.domain.clone(),
enable_tls: self.enable_tls.unwrap_or(false),
enable_credssp: self.enable_credssp.unwrap_or(true),
keyboard_layout: self.keyboard_layout.unwrap_or(0),
keyboard_type: self
.keyboard_type
.unwrap_or(ironrdp::pdu::gcc::KeyboardType::IbmEnhanced),