Esempio n. 1
0
        private void imgTablet_MouseDown(object sender, MouseEventArgs e)
        {
            if (this.keyLayouts != null)
            {
                foreach (HuionKeyLayout keyLayout in this.keyLayouts)
                {
                    if (keyLayout.mouseEnter(e.X, e.Y))
                    {
                        this.mCheckedKeyLayout = keyLayout;
                        this.imgTablet.Refresh();
                        if (this.mCheckedKeyLayout.KeyType == HuionKeyType.MULTIKEY)
                        {
                            this.comboBoxMekey.Visible = true;
                            this.comboBoxMekey.Text    = this.mCheckedKeyLayout.MutliKeys[this.mTouchIndex].ToString();
                            this.clickBtn.Visible      = false;
                            break;
                        }

                        this.comboBoxMekey.Visible = false;
                        this.clickBtn.Visible      = true;
                        this.clickBtn.Text         = this.mCheckedKeyLayout.Key.ToString();
                        break;
                    }
                }
            }

            TimerSession.userOperation();
        }
Esempio n. 2
0
 public void readDisConnectConfig()
 {
     TimerSession.stopAutoConnection();
     HNStruct.tabletTextInfo = HNStruct.globalInfo.bOpenedTablet
         ? ResourceCulture.GetString("FormHuionTablet_lbOpenTabletText")
         : ResourceCulture.GetString("FormHuionTablet_lbCloseTabletText");
 }
Esempio n. 3
0
        private void imgTablet_MouseMove(object sender, MouseEventArgs e)
        {
            TimerSession.userOperation();
            if (this.mCurrentKeyLayout != null && this.mCurrentKeyLayout.mouseEnter(e.X, e.Y))
            {
                this.imgTablet.Cursor = Cursors.Hand;
            }
            else
            {
                if (this.keyLayouts != null)
                {
                    foreach (HuionKeyLayout keyLayout in this.keyLayouts)
                    {
                        if (keyLayout.mouseEnter(e.X, e.Y))
                        {
                            this.mCurrentKeyLayout = keyLayout;
                            this.imgTablet.Refresh();
                            this.imgTablet.Cursor = Cursors.Hand;
                            return;
                        }
                    }
                }

                this.imgTablet.Cursor = Cursors.Default;
            }
        }
Esempio n. 4
0
 protected override void OnMouseDown(MouseEventArgs e)
 {
     base.OnMouseDown(e);
     TimerSession.userOperation();
     this.mMouseButton   = e.Button;
     this.mMouseLocation = e.Location;
 }
Esempio n. 5
0
 protected override void WndProc(ref Message m)
 {
     base.WndProc(ref m);
     if (m.Msg == 512)
     {
         TimerSession.userOperation();
     }
     if (m.Msg == 32752)
     {
         PACKET?nullable = HuionApi.SafeMsg2Packet(m);
         if (!nullable.HasValue)
         {
             return;
         }
         HNStruct.globalInfo.penData.ps = nullable.Value.pkNormalPressure;
         this.onPressValueHandle((int)HNStruct.globalInfo.penData.ps);
         this.drawLineHelper.onDrawline();
     }
     else
     {
         if (m.Msg != 1064)
         {
             return;
         }
         HNStruct.globalInfo.penData = TouchInfoReader.Msg2Packet(m);
         this.onPressValueHandle((int)HNStruct.globalInfo.penData.ps);
         this.drawLineHelper.onDrawline();
     }
 }
Esempio n. 6
0
        private static void Main(string[] args)
        {
            HNStruct.OemType = DeployConfig.getOemType();
            HuionLog.listenGlobalCrashLog();
            ResourceCulture.init();
            TimerSession.startListenUserOperation();
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            bool flag = false;

            try
            {
                flag = Utils.isAppRunning();
            }
            catch
            {
                Utils.runAsAdmin(true);
                return;
            }

            if (new Mutex(true, "OnlyRun").WaitOne(0, false))
            {
                Application.Run((Form) new HuionTalbet());
            }
            else
            {
                if (Utils.isStartup(args) ||
                    HuionDriverDLL.PostMessage(HuionDriverDLL.FindWindow((string)null, Fixer4Main.FormTitle()), 1054,
                                               IntPtr.Zero, IntPtr.Zero) != 0)
                {
                    return;
                }
                Utils.runAsAdmin(true);
            }
        }
Esempio n. 7
0
        private void btnSendNoise_Click(object sender, EventArgs e)
        {
            Messagefromself(txtMessage.Text);
            //tạo chuỗi mã hóa tin nhắn ban đầu + hash time
            string s = md5.maHoaMd5(txtMessage.Text);

            dateTimeIV = md5.maHoaMd5(DateTime.Now.ToString());
            string Mahoa_time = s + ";" + dateTimeIV;

            //tạo các chữ random để chèn vào
            char[] chars = "abcdefghijklmnopqrstuvwxyz1234567890".ToCharArray();
            Random r     = new Random();
            int    i     = r.Next(chars.Length);
            int    vitri = r.Next(0, txtMessage.TextLength);

            //Chuỗi Đã thay đổi
            txtMessage.Text = RandomString(txtMessage.Text, chars[i].ToString(), vitri) + ";" + Mahoa_time;
            foreach (Socket item in clientList)
            {
                Send(item);
            }
            TimerSession.Stop();
            sec = 21;
            TimerSession.Start();
        }
Esempio n. 8
0
 protected override void WndProc(ref Message m)
 {
     if (m.Msg == 512)
     {
         TimerSession.userOperation();
     }
     base.WndProc(ref m);
 }
Esempio n. 9
0
 protected override void WndProc(ref Message m)
 {
     base.WndProc(ref m);
     if (m.Msg != 512)
     {
         return;
     }
     TimerSession.userOperation();
 }
Esempio n. 10
0
 private void setTabPanelClicked(Panel v, TabType tab)
 {
     this.mTabType = tab;
     this.clearForms();
     TimerSession.userOperation();
     this.panelHotKey.Refresh();
     this.panelInfo.Refresh();
     this.panelTabletPen.Refresh();
     this.panelWorkArea.Refresh();
 }
Esempio n. 11
0
        protected override void WndProc(ref Message m)
        {
            base.WndProc(ref m);
            switch (m.Msg)
            {
            case 126:
                break;

            case 512:
                TimerSession.userOperation();
                break;

            case 536:
                switch (m.WParam.ToInt32())
                {
                case 4:
                    this.timer3.Stop();
                    ThreadPool.QueueUserWorkItem(new WaitCallback(TabletConfigUtils.closeDevice));
                    break;

                case 7:
                    this.timer3.Start();
                    break;
                }

                MiddleModule.eventPost += new Post(this.MiddleModule_eventPost);
                break;

            case 1044:
                break;

            case 1054:
                if (this.Visible)
                {
                    break;
                }
                this.Show();
                this.WindowState = FormWindowState.Normal;
                break;

            case 1064:
                if (this.Visible)
                {
                    break;
                }
                KeyboardUtils.listenHotKey(this.Handle, new Void(this.KeyboardUtils_showFormEvent),
                                           SettingsUtil.ShowUIShortcut);
                break;

            default:
                Fixer4Main.onDeviceChanged(ref m);
                KeyboardUtils.onHotKey(ref m);
                break;
            }
        }
Esempio n. 12
0
        /// <summary>
        /// Restart is called when a core boots
        /// </summary>
        public void Restart()
        {
            if (m_timerSession != null)
            {
                m_timerSession.Dispose();
            }

            m_timerSession = new TimerSession(m_splitProfile, MemoryDomains, Debuggable);

            //Debuggable.MemoryCallbacks.Add(new MemoryCallback(MemoryDomains.MainMemory.Name, MemoryCallbackType.Write, "", OnMemoryWrite, 0x079c, null));
        }
Esempio n. 13
0
 public void onMouseDown(object sender, MouseEventArgs e)
 {
     TimerSession.userOperation();
     this.isMouseDown = true;
     if (!this.IsDrawLine)
     {
         return;
     }
     this.mStartPoint = e.Location;
     this.onDrawline(e.Location);
 }
Esempio n. 14
0
 private void Server_Load(object sender, EventArgs e)
 {
     TimerSession.Start();
 }
Esempio n. 15
0
 public static void onMouseMove(object sender, EventArgs e)
 {
     TimerSession.userOperation();
 }
Esempio n. 16
0
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);
            TimerSession.userOperation();
            if (this.mMouseButton == MouseButtons.Left)
            {
                Point location = e.Location;
                int   num1     = location.X - this.mMouseLocation.X;
                location = e.Location;
                int   num2   = location.Y - this.mMouseLocation.Y;
                float ratioX = (float)Math.Round((double)num1 / (double)this.mScreenRect.Width, 3);
                float ratioY = (float)Math.Round((double)num2 / (double)this.mScreenRect.Height, 3);
                if (this.mMouseInRect == this.mScreenDrawRect)
                {
                    onRectChanged(ref this.mScreenRectRatio, this.locationType, ratioX, ratioY);
                }
                else if (this.mMouseInRect == this.mDeviceDrawRect)
                {
                    onRectChanged(ref this.mDeviceDrawRectRatio, this.locationType, ratioX, ratioY);
                }
                this.mMouseLocation = e.Location;
                if (this.mMouseInRect == this.mScreenDrawRect)
                {
                    this.measureScreenRect();
                    this.mMouseInRect = this.mScreenDrawRect;
                }
                else
                {
                    if (!(this.mMouseInRect == this.mDeviceDrawRect))
                    {
                        return;
                    }
                    this.measureDeviceRect();
                    this.mMouseInRect = this.mDeviceDrawRect;
                }
            }
            else
            {
                if (this.mMouseInRect != Rectangle.Empty)
                {
                    this.locationType = ViewUtils.locationType(this.mMouseInRect, e.Location);
                    if (this.locationType == MouseLocationType.EXTERNAL)
                    {
                        this.mMouseInRect = Rectangle.Empty;
                    }
                    else
                    {
                        this.Cursor = ViewUtils.getCursor8LocationType(this.locationType, this.Cursor);
                        return;
                    }
                }

                this.locationType = ViewUtils.locationType(this.mScreenDrawRect, e.Location);
                if (this.locationType == MouseLocationType.EXTERNAL)
                {
                    this.mMouseInRect = Rectangle.Empty;
                    this.locationType = ViewUtils.locationType(this.mDeviceDrawRect, e.Location);
                    if (this.locationType == MouseLocationType.EXTERNAL)
                    {
                        this.Cursor       = Cursors.Default;
                        this.mMouseInRect = Rectangle.Empty;
                    }
                    else
                    {
                        this.mMouseInRect = this.mDeviceDrawRect;
                        this.Cursor       = ViewUtils.getCursor8LocationType(this.locationType, this.Cursor);
                    }
                }
                else
                {
                    this.mMouseInRect = this.mScreenDrawRect;
                    this.Cursor       = ViewUtils.getCursor8LocationType(this.locationType, this.Cursor);
                }
            }
        }
Esempio n. 17
0
 public void onMouseMove(object sender, MouseEventArgs e)
 {
     TimerSession.userOperation();
     this.isMouseDown = false;
     this.onDrawline(e.Location);
 }