<commit_before>﻿using ScpDriverInterface;
using System;
using System.Threading;
using System.Windows.Forms;
using XboxKeyboardMouse.Libs;

namespace XboxKeyboardMouse {
    class Activate {
        const int CONTROLLER_NUMBER = 1;
        static ScpBus scpbus = null;
        public static X360Controller Controller;

        public static Thread tXboxStream, tKMInput;

        private static X360Controller CreateController() {
            X360Controller controller = new X360Controller();

            try {
                scpbus = new ScpBus();
            } catch (Exception ex) {
                MessageBox.Show("SCP Bus failed to initialize");
                MessageBox.Show(ex.ToString());
            }

            scpbus.PlugIn(1);

            return controller;
        }<commit_msg>Improve SCP activation error handling. * Shows a single MessageBox instead of two, with combined messaging. * Adds a helpful user suggestion that should solve this error for most people. * Exits cleanly (non-zero) afterwards, since the error is not recoverable.<commit_after>﻿using ScpDriverInterface;
using System;
using System.Threading;
using System.Windows.Forms;
using XboxKeyboardMouse.Libs;

namespace XboxKeyboardMouse {
    class Activate {
        const int CONTROLLER_NUMBER = 1;
        static ScpBus scpbus = null;
        public static X360Controller Controller;

        public static Thread tXboxStream, tKMInput;

        private static X360Controller CreateController() {
            X360Controller controller = new X360Controller();

            try {
                scpbus = new ScpBus();
            } catch (Exception ex) {
                MessageBox.Show("You probably need to run the ScpToolkit Driver Installer." +
                                System.Environment.NewLine + System.Environment.NewLine + ex.ToString(),
                                "SCP Bus failed to initialize");
                Environment.Exit(-1);
            }

            scpbus.PlugIn(1);

            return controller;
        }
{'fraction_non_alphanumeric': 0.06886374815543532, 'fraction_numerical': 0.01426463354648303, 'mean_word_length': 2.2031496062992124, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7055047', 'n_tokens_mistral': 533, 'n_tokens_neox': 493, 'n_words': 159}