Index: format/app_mouse.format
===================================================================
--- /YC1308AF/branch/mouse/YDN_Project/222D_bt_24g/format/app_mouse.format	(revision 2300)
+++ /YC1308AF/branch/mouse/YDN_Project/222D_bt_24g/format/app_mouse.format	(working copy)
@@ -478,6 +478,8 @@
 0X06 MOUSE_RM_BUTTON
 0X07 MOUSE_LMR_BUTTON
 0x09 MOUSE_L_BK_BUTTON
+0x0a MOUSE_R_BK_BUTTON
+0x11 MOUSE_L_FW_BUTTON
 0x14 MOUSE_M_FW_BUTTON
 0X18 MOUSE_BK_FW_BUTTON
 //mouse default gpio
Index: output/eeprom.dat
===================================================================
--- /YC1308AF/branch/mouse/YDN_Project/222D_bt_24g/output/eeprom.dat	(revision 2300)
+++ /YC1308AF/branch/mouse/YDN_Project/222D_bt_24g/output/eeprom.dat	(working copy)
@@ -2,7 +2,7 @@
 02
 aa
 55
-32
+6a
 19
 c2
 84
@@ -67,7 +67,7 @@
 c0
 68
 06
-16
+17
 c0
 69
 03
@@ -579,7 +579,7 @@
 70
 8a
 39
-04
+0a
 70
 8a
 3a
@@ -3811,7 +3811,7 @@
 20
 40
 06
-46
+47
 d8
 40
 00
@@ -4043,7 +4043,7 @@
 20
 40
 06
-49
+4a
 68
 48
 c9
@@ -6231,11 +6231,15 @@
 20
 40
 06
-16
+17
+20
+40
+06
+4d
 20
 20
 41
-1d
+1e
 6f
 e0
 cb
@@ -6251,15 +6255,15 @@
 20
 40
 06
-1d
+1e
 20
 40
 06
-2c
+2d
 20
 40
 06
-39
+3a
 20
 20
 41
@@ -6271,7 +6275,7 @@
 20
 40
 06
-46
+47
 20
 40
 41
@@ -6291,7 +6295,7 @@
 20
 40
 06
-46
+47
 20
 40
 41
@@ -6311,7 +6315,7 @@
 20
 40
 06
-46
+47
 20
 40
 41
@@ -6355,7 +6359,7 @@
 c0
 7f
 86
-35
+36
 20
 20
 41
@@ -6367,7 +6371,7 @@
 20
 40
 06
-49
+4a
 68
 48
 c9
@@ -6407,7 +6411,7 @@
 c0
 7f
 86
-42
+43
 20
 20
 41
@@ -6419,7 +6423,7 @@
 20
 40
 06
-49
+4a
 68
 48
 c9
@@ -6452,8 +6456,60 @@
 20
 61
 2c
-db
-98
+70
+4b
+a9
+00
+70
+4b
+aa
+00
+70
+4b
+ab
+00
+1f
+e2
+04
+00
+20
+40
+06
+54
+20
+40
+06
+57
+20
+20
+41
+33
+18
+41
+7e
+11
+c0
+08
+c1
+4e
+20
+60
+00
+00
+18
+41
+7e
+0a
+c0
+05
+41
+4e
+20
+60
+00
+00
+4b
+d4
 aa
 55
 40
@@ -7834,64 +7890,8 @@
 55
 aa
 96
-53
-28
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
+44
+f8
 ff
 ff
 ff
@@ -8188,5 +8188,5 @@
 ff
 ff
 ff
-96
-a9
+19
+32
Index: output/flash.dat
===================================================================
--- /YC1308AF/branch/mouse/YDN_Project/222D_bt_24g/output/flash.dat	(revision 2300)
+++ /YC1308AF/branch/mouse/YDN_Project/222D_bt_24g/output/flash.dat	(working copy)
@@ -2,7 +2,7 @@
 02
 aa
 55
-32
+6a
 19
 c2
 84
@@ -67,7 +67,7 @@
 c0
 68
 06
-16
+17
 c0
 69
 03
@@ -579,7 +579,7 @@
 70
 8a
 39
-04
+0a
 70
 8a
 3a
@@ -3811,7 +3811,7 @@
 20
 40
 06
-46
+47
 d8
 40
 00
@@ -4043,7 +4043,7 @@
 20
 40
 06
-49
+4a
 68
 48
 c9
@@ -6231,11 +6231,15 @@
 20
 40
 06
-16
+17
+20
+40
+06
+4d
 20
 20
 41
-1d
+1e
 6f
 e0
 cb
@@ -6251,15 +6255,15 @@
 20
 40
 06
-1d
+1e
 20
 40
 06
-2c
+2d
 20
 40
 06
-39
+3a
 20
 20
 41
@@ -6271,7 +6275,7 @@
 20
 40
 06
-46
+47
 20
 40
 41
@@ -6291,7 +6295,7 @@
 20
 40
 06
-46
+47
 20
 40
 41
@@ -6311,7 +6315,7 @@
 20
 40
 06
-46
+47
 20
 40
 41
@@ -6355,7 +6359,7 @@
 c0
 7f
 86
-35
+36
 20
 20
 41
@@ -6367,7 +6371,7 @@
 20
 40
 06
-49
+4a
 68
 48
 c9
@@ -6407,7 +6411,7 @@
 c0
 7f
 86
-42
+43
 20
 20
 41
@@ -6419,7 +6423,7 @@
 20
 40
 06
-49
+4a
 68
 48
 c9
@@ -6452,8 +6456,60 @@
 20
 61
 2c
-db
-98
+70
+4b
+a9
+00
+70
+4b
+aa
+00
+70
+4b
+ab
+00
+1f
+e2
+04
+00
+20
+40
+06
+54
+20
+40
+06
+57
+20
+20
+41
+33
+18
+41
+7e
+11
+c0
+08
+c1
+4e
+20
+60
+00
+00
+18
+41
+7e
+0a
+c0
+05
+41
+4e
+20
+60
+00
+00
+4b
+d4
 aa
 55
 40
@@ -7834,64 +7890,8 @@
 55
 aa
 96
-53
-28
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
+44
+f8
 ff
 ff
 ff
@@ -8188,5 +8188,5 @@
 ff
 ff
 ff
-96
-a9
+19
+32
Index: output/program.lis
===================================================================
--- /YC1308AF/branch/mouse/YDN_Project/222D_bt_24g/output/program.lis	(revision 2300)
+++ /YC1308AF/branch/mouse/YDN_Project/222D_bt_24g/output/program.lis	(working copy)
@@ -15,7 +15,7 @@
 000c c06685ea beq patch19_5 ,p_mouse_motion 
 000d c0670400 beq patch19_6 ,p_mouse_dpi_process 
 000e c0678421 beq patch19_7 ,p_mouse_seting_dpi 
-000f c0680616 beq patch1a_0 ,p_mouse_check_key_gpio 
+000f c0680617 beq patch1a_0 ,p_mouse_check_key_gpio 
 0010 c069037b beq patch1a_2 ,p_mouse_init_sunt 
 0011 c0698393 beq patch1a_3 ,p_mouse_sensor_poweron 
 0012 c06a849e beq patch1a_5 ,p_mouse_priority_bb_event 
@@ -181,7 +181,7 @@
 008e 20201226 branch set_rf_ldo_cfg89 
 
 p_set_tx_power_pair:
-008f 708a3904 jam 0x04 ,core_tx_pwr_ctrl0 
+008f 708a390a jam 0x0a ,core_tx_pwr_ctrl0 
 0090 708a3a00 jam 0x00 ,core_tx_pwr_ctrl1 
 0091 20201226 branch set_rf_ldo_cfg89 
 
@@ -1285,7 +1285,7 @@
 03b4 6848c914 fetcht 1 ,mem_matrix_public_gpio 
 03b5 204060e6 call gpio_clr_wake 
 03b6 6fe0c924 fetch 1 ,mem_mouse_sensor_sdio_gpio 
-03b7 20400646 call p_mouse_gpio_config_output_high 
+03b7 20400647 call p_mouse_gpio_config_output_high 
 03b8 d8400003 arg 3 ,temp 
 03b9 20403f96 call mouse_gpio_config_input_pu 
 03ba 20403e80 call mouse_lpm_before_common 
@@ -1363,7 +1363,7 @@
 
 p_mouse_3io6key_dpi_check:
 03f0 6fe0c913 fetch 1 ,mem_dpi_button_gpio 
-03f1 20400649 call p_mouse_gpio_config_output_low 
+03f1 2040064a call p_mouse_gpio_config_output_low 
 03f2 6848c913 fetcht 1 ,mem_dpi_button_gpio 
 03f3 202041d5 branch mouse_3io6key_check 
 
@@ -2106,82 +2106,102 @@
 0613 20204758 branch mouse_drawing_optima 
 
 p_mouse_key:
-0614 20400616 call p_mouse_check_key_gpio 
-0615 2020411d branch mouse_key + 1 
+0614 20400617 call p_mouse_check_key_gpio 
+0615 2040064d call p_mouse_ghost_key_check 
+0616 2020411e branch mouse_key + 2 
 
 p_mouse_check_key_gpio:
-0616 6fe0cbf2 fetch 1 ,mem_sensor_shutdown_flag 
-0617 245a4161 ncall mouse_check_key_gpio_once ,blank 
-0618 da200000 arg 0 ,rega 
-0619 2040061d call p_mouse_check_lkey_gpio 
-061a 2040062c call p_mouse_check_bkkey_gpio 
-061b 20400639 call p_mouse_check_fwkey_gpio 
-061c 2020415e branch mouse_check_key_gpio_next 
+0617 6fe0cbf2 fetch 1 ,mem_sensor_shutdown_flag 
+0618 245a4161 ncall mouse_check_key_gpio_once ,blank 
+0619 da200000 arg 0 ,rega 
+061a 2040061e call p_mouse_check_lkey_gpio 
+061b 2040062d call p_mouse_check_bkkey_gpio 
+061c 2040063a call p_mouse_check_fwkey_gpio 
+061d 2020415e branch mouse_check_key_gpio_next 
 
 p_mouse_check_lkey_gpio:
-061d 6fe0c91c fetch 1 ,mem_lbutton_gpio 
-061e 20400646 call p_mouse_gpio_config_output_high 
-061f 20404164 call mouse_check_lkey_gpio 
-0620 6848c91c fetcht 1 ,mem_lbutton_gpio 
-0621 20403f96 call mouse_gpio_config_input_pu 
+061e 6fe0c91c fetch 1 ,mem_lbutton_gpio 
+061f 20400647 call p_mouse_gpio_config_output_high 
+0620 20404164 call mouse_check_lkey_gpio 
+0621 6848c91c fetcht 1 ,mem_lbutton_gpio 
+0622 20403f96 call mouse_gpio_config_input_pu 
 
 p_mouse_check_rkey_gpio:
-0622 6fe0c91d fetch 1 ,mem_rbutton_gpio 
-0623 20400646 call p_mouse_gpio_config_output_high 
-0624 2040416a call mouse_check_rkey_gpio 
-0625 6848c91d fetcht 1 ,mem_rbutton_gpio 
-0626 20403f96 call mouse_gpio_config_input_pu 
+0623 6fe0c91d fetch 1 ,mem_rbutton_gpio 
+0624 20400647 call p_mouse_gpio_config_output_high 
+0625 2040416a call mouse_check_rkey_gpio 
+0626 6848c91d fetcht 1 ,mem_rbutton_gpio 
+0627 20403f96 call mouse_gpio_config_input_pu 
 
 p_mouse_check_mkey_gpio:
-0627 6fe0c91e fetch 1 ,mem_mbutton_gpio 
-0628 20400646 call p_mouse_gpio_config_output_high 
-0629 20404170 call mouse_check_mkey_gpio 
-062a 6848c91e fetcht 1 ,mem_mbutton_gpio 
-062b 20203f96 branch mouse_gpio_config_input_pu 
+0628 6fe0c91e fetch 1 ,mem_mbutton_gpio 
+0629 20400647 call p_mouse_gpio_config_output_high 
+062a 20404170 call mouse_check_mkey_gpio 
+062b 6848c91e fetcht 1 ,mem_mbutton_gpio 
+062c 20203f96 branch mouse_gpio_config_input_pu 
 
 p_mouse_check_bkkey_gpio:
-062c 6fe0c911 fetch 1 ,mem_bk_button_gpio 
-062d c17f8000 rtneq gpio_disable 
-062e 704ba703 jam mouse_bk_key ,mem_mouse_key_temp 
-062f 6fe0cba2 fetch 1 ,mem_mouse_bkkey_press_status 
-0630 1fe22600 copy pdata ,regc 
-0631 6848c911 fetcht 1 ,mem_bk_button_gpio 
-0632 6fe0c914 fetch 1 ,mem_matrix_public_gpio 
-0633 c07f8635 beq gpio_disable ,p_mouse_3io6key_bk_check 
-0634 2020417e branch mouse_check_bkkey_gpio_next 
+062d 6fe0c911 fetch 1 ,mem_bk_button_gpio 
+062e c17f8000 rtneq gpio_disable 
+062f 704ba703 jam mouse_bk_key ,mem_mouse_key_temp 
+0630 6fe0cba2 fetch 1 ,mem_mouse_bkkey_press_status 
+0631 1fe22600 copy pdata ,regc 
+0632 6848c911 fetcht 1 ,mem_bk_button_gpio 
+0633 6fe0c914 fetch 1 ,mem_matrix_public_gpio 
+0634 c07f8636 beq gpio_disable ,p_mouse_3io6key_bk_check 
+0635 2020417e branch mouse_check_bkkey_gpio_next 
 
 p_mouse_3io6key_bk_check:
-0635 6fe0c911 fetch 1 ,mem_bk_button_gpio 
-0636 20400649 call p_mouse_gpio_config_output_low 
-0637 6848c911 fetcht 1 ,mem_bk_button_gpio 
-0638 2020418b branch mouse_3io6key_bk_check 
+0636 6fe0c911 fetch 1 ,mem_bk_button_gpio 
+0637 2040064a call p_mouse_gpio_config_output_low 
+0638 6848c911 fetcht 1 ,mem_bk_button_gpio 
+0639 2020418b branch mouse_3io6key_bk_check 
 
 p_mouse_check_fwkey_gpio:
-0639 6fe0c912 fetch 1 ,mem_fw_button_gpio 
-063a c17f8000 rtneq gpio_disable 
-063b 704ba704 jam mouse_fw_key ,mem_mouse_key_temp 
-063c 6fe0cba3 fetch 1 ,mem_mouse_fwkey_press_status 
-063d 1fe22600 copy pdata ,regc 
-063e 6848c912 fetcht 1 ,mem_fw_button_gpio 
-063f 6fe0c914 fetch 1 ,mem_matrix_public_gpio 
-0640 c07f8642 beq gpio_disable ,p_mouse_3io6key_fw_check 
-0641 20204197 branch mouse_check_fwkey_gpio_next 
+063a 6fe0c912 fetch 1 ,mem_fw_button_gpio 
+063b c17f8000 rtneq gpio_disable 
+063c 704ba704 jam mouse_fw_key ,mem_mouse_key_temp 
+063d 6fe0cba3 fetch 1 ,mem_mouse_fwkey_press_status 
+063e 1fe22600 copy pdata ,regc 
+063f 6848c912 fetcht 1 ,mem_fw_button_gpio 
+0640 6fe0c914 fetch 1 ,mem_matrix_public_gpio 
+0641 c07f8643 beq gpio_disable ,p_mouse_3io6key_fw_check 
+0642 20204197 branch mouse_check_fwkey_gpio_next 
 
 p_mouse_3io6key_fw_check:
-0642 6fe0c912 fetch 1 ,mem_fw_button_gpio 
-0643 20400649 call p_mouse_gpio_config_output_low 
-0644 6848c912 fetcht 1 ,mem_fw_button_gpio 
-0645 202041a4 branch mouse_3io6key_fw_check 
+0643 6fe0c912 fetch 1 ,mem_fw_button_gpio 
+0644 2040064a call p_mouse_gpio_config_output_low 
+0645 6848c912 fetcht 1 ,mem_fw_button_gpio 
+0646 202041a4 branch mouse_3io6key_fw_check 
 
 p_mouse_gpio_config_output_high:
-0646 c17f8000 rtneq gpio_disable 
-0647 d840003f arg gpcfg_output_high ,temp 
-0648 2020612c branch gpio_config_function_int 
+0647 c17f8000 rtneq gpio_disable 
+0648 d840003f arg gpcfg_output_high ,temp 
+0649 2020612c branch gpio_config_function_int 
 
 p_mouse_gpio_config_output_low:
-0649 c17f8000 rtneq gpio_disable 
-064a d840003e arg gpcfg_output_low ,temp 
-064b 2020612c branch gpio_config_function_int 
+064a c17f8000 rtneq gpio_disable 
+064b d840003e arg gpcfg_output_low ,temp 
+064c 2020612c branch gpio_config_function_int 
+
+p_mouse_ghost_key_check:
+064d 704ba900 jam 0 ,mem_mouse_matrix_key_cow_count 
+064e 704baa00 jam 0 ,mem_mouse_matrix_key_row_count 
+064f 704bab00 jam 0 ,mem_mouse_ghost_flag 
+0650 1fe20400 copy pdata ,temp 
+0651 20400654 call p_mouse_ghost_key_check_l_fw 
+0652 20400657 call p_mouse_ghost_key_check_r_bk 
+0653 20204133 branch mouse_ghost_key_check + 6 
+
+p_mouse_ghost_key_check_l_fw:
+0654 18417e11 and temp ,mouse_l_fw_button ,pdata 
+0655 c008c14e beq mouse_l_fw_button ,mouse_matrix_cow_more_than_one_key 
+0656 20600000 rtn 
+
+p_mouse_ghost_key_check_r_bk:
+0657 18417e0a and temp ,mouse_r_bk_button ,pdata 
+0658 c005414e beq mouse_r_bk_button ,mouse_matrix_cow_more_than_one_key 
+0659 20600000 rtn 
               org 0x800
 
 start:
Index: output/ramcode.rom
===================================================================
--- /YC1308AF/branch/mouse/YDN_Project/222D_bt_24g/output/ramcode.rom	(revision 2300)
+++ /YC1308AF/branch/mouse/YDN_Project/222D_bt_24g/output/ramcode.rom	(working copy)
@@ -13,7 +13,7 @@
 c06685ea
 c0670400
 c0678421
-c0680616
+c0680617
 c069037b
 c0698393
 c06a849e
@@ -141,7 +141,7 @@
 708a390a
 708a3a00
 20201226
-708a3904
+708a390a
 708a3a00
 20201226
 20406e5e
@@ -949,7 +949,7 @@
 6848c914
 204060e6
 6fe0c924
-20400646
+20400647
 d8400003
 20403f96
 20403e80
@@ -1007,7 +1007,7 @@
 c07f83f0
 2020407f
 6fe0c913
-20400649
+2040064a
 6848c913
 202041d5
 18427e00
@@ -1554,27 +1554,28 @@
 6fe0c92c
 c1018000
 20204758
-20400616
-2020411d
+20400617
+2040064d
+2020411e
 6fe0cbf2
 245a4161
 da200000
-2040061d
-2040062c
-20400639
+2040061e
+2040062d
+2040063a
 2020415e
 6fe0c91c
-20400646
+20400647
 20404164
 6848c91c
 20403f96
 6fe0c91d
-20400646
+20400647
 2040416a
 6848c91d
 20403f96
 6fe0c91e
-20400646
+20400647
 20404170
 6848c91e
 20203f96
@@ -1585,10 +1586,10 @@
 1fe22600
 6848c911
 6fe0c914
-c07f8635
+c07f8636
 2020417e
 6fe0c911
-20400649
+2040064a
 6848c911
 2020418b
 6fe0c912
@@ -1598,10 +1599,10 @@
 1fe22600
 6848c912
 6fe0c914
-c07f8642
+c07f8643
 20204197
 6fe0c912
-20400649
+2040064a
 6848c912
 202041a4
 c17f8000
@@ -1610,3 +1611,16 @@
 c17f8000
 d840003e
 2020612c
+704ba900
+704baa00
+704bab00
+1fe20400
+20400654
+20400657
+20204133
+18417e11
+c008c14e
+20600000
+18417e0a
+c005414e
+20600000
Index: program/patch.prog
===================================================================
--- /YC1308AF/branch/mouse/YDN_Project/222D_bt_24g/program/patch.prog	(revision 2300)
+++ /YC1308AF/branch/mouse/YDN_Project/222D_bt_24g/program/patch.prog	(working copy)
@@ -210,7 +210,7 @@
 	branch set_rf_ldo_cfg89
 
 p_set_tx_power_pair:
-	jam 0x04,core_tx_pwr_ctrl0
+	jam 0x0a,core_tx_pwr_ctrl0
 	jam 0x00,core_tx_pwr_ctrl1
 	branch set_rf_ldo_cfg89
 
@@ -2765,7 +2765,8 @@
 	nbranch p_fire_key_process,blank
 endif	
 	call p_mouse_check_key_gpio
-	branch mouse_key+1
+	call p_mouse_ghost_key_check
+	branch mouse_key+2
 
 p_mouse_check_key_gpio:
 	fetch 1,mem_sensor_shutdown_flag
@@ -2844,6 +2845,25 @@
 	arg gpcfg_output_low,temp
 	branch gpio_config_function_int
 
+p_mouse_ghost_key_check:
+	jam 0,mem_mouse_matrix_key_cow_count
+	jam 0,mem_mouse_matrix_key_row_count
+	jam 0,mem_mouse_ghost_flag
+	copy pdata,temp
+	call p_mouse_ghost_key_check_L_FW
+	call p_mouse_ghost_key_check_R_BK
+	branch mouse_ghost_key_check+6
+
+p_mouse_ghost_key_check_L_FW:
+	and temp,MOUSE_L_FW_BUTTON,pdata
+	beq MOUSE_L_FW_BUTTON,mouse_matrix_cow_more_than_one_key
+	rtn
+
+p_mouse_ghost_key_check_R_BK:
+	and temp,MOUSE_R_BK_BUTTON,pdata
+	beq MOUSE_R_BK_BUTTON,mouse_matrix_cow_more_than_one_key
+	rtn
+
 
 ///////////////////////////// 2.4g ota  start ///////////////////////////////////////////////////////////
 ifdef G24_OTA
