LibCecSharp: update the local configuration after connecting
[deb_libcec.git] / src / LibCecSharp / LibCecSharp.cpp
index fb723236eb0fa4fd3892dbc7b65c8ff3aa050d9f..3ce95dfcbf0b4d4f46b08c9c4563abc4f6532d23 100644 (file)
@@ -82,6 +82,7 @@ namespace CecSharp
                        ConvertConfiguration(context, config, libCecConfig);
 
                        m_libCec = (ICECAdapter *) CECInitialise(&libCecConfig);
+                       config->Update(libCecConfig);
 
                        delete context;
                        return m_libCec != NULL;
@@ -134,6 +135,11 @@ namespace CecSharp
                                memcpy_s(config.strDeviceLanguage, 3, strDeviceLanguage, 3);
                        }
 
+                       if (netConfig->ServerVersion >= CecServerVersion::Version1_6_3)
+                       {
+                         config.bMonitorOnly              = netConfig->MonitorOnlyClient ? 1 : 0;
+                       }
+
                        config.callbacks            = &g_cecCallbacks;
                }
 
@@ -230,7 +236,7 @@ namespace CecSharp
                        cec_keypress key;
                        if (m_libCec->GetNextKeypress(&key))
                        {
-                               return gcnew CecKeypress(key.keycode, key.duration);
+                               return gcnew CecKeypress((CecUserControlCode)key.keycode, key.duration);
                        }
 
                        return gcnew CecKeypress();