Index: format/app_mouse.format
===================================================================
--- /YC1308AF/branch/mouse/YDN_Project/222L_bt_24g/format/app_mouse.format	(revision 2328)
+++ /YC1308AF/branch/mouse/YDN_Project/222L_bt_24g/format/app_mouse.format	(working copy)
@@ -477,6 +477,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/222L_bt_24g/output/eeprom.dat	(revision 2328)
+++ /YC1308AF/branch/mouse/YDN_Project/222L_bt_24g/output/eeprom.dat	(working copy)
@@ -2,7 +2,7 @@
 02
 aa
 55
-b6
+ee
 19
 c2
 84
@@ -67,7 +67,7 @@
 c0
 68
 06
-37
+38
 c0
 69
 03
@@ -587,7 +587,7 @@
 70
 8a
 39
-04
+0a
 70
 8a
 3a
@@ -3887,7 +3887,7 @@
 20
 40
 06
-67
+68
 d8
 40
 00
@@ -4107,7 +4107,7 @@
 20
 40
 06
-6a
+6b
 68
 48
 c9
@@ -6363,11 +6363,15 @@
 20
 40
 06
-37
+38
+20
+40
+06
+6e
 20
 20
 41
-1d
+1e
 6f
 e0
 cb
@@ -6383,15 +6387,15 @@
 20
 40
 06
-3e
+3f
 20
 40
 06
-4d
+4e
 20
 40
 06
-5a
+5b
 20
 20
 41
@@ -6403,7 +6407,7 @@
 20
 40
 06
-67
+68
 20
 40
 41
@@ -6423,7 +6427,7 @@
 20
 40
 06
-67
+68
 20
 40
 41
@@ -6443,7 +6447,7 @@
 20
 40
 06
-67
+68
 20
 40
 41
@@ -6487,7 +6491,7 @@
 c0
 7f
 86
-56
+57
 20
 20
 41
@@ -6499,7 +6503,7 @@
 20
 40
 06
-6a
+6b
 68
 48
 c9
@@ -6539,7 +6543,7 @@
 c0
 7f
 86
-63
+64
 20
 20
 41
@@ -6551,7 +6555,7 @@
 20
 40
 06
-6a
+6b
 68
 48
 c9
@@ -6584,8 +6588,60 @@
 20
 61
 2c
-7a
-0b
+70
+4b
+a9
+00
+70
+4b
+aa
+00
+70
+4b
+ab
+00
+1f
+e2
+04
+00
+20
+40
+06
+75
+20
+40
+06
+78
+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
+6f
+ff
 aa
 55
 40
@@ -7966,64 +8022,8 @@
 55
 62
 99
-0a
-ac
-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
+85
+a6
 ff
 ff
 ff
@@ -8188,5 +8188,5 @@
 ff
 ff
 ff
-b5
-fd
+d4
+8d
Index: output/flash.dat
===================================================================
--- /YC1308AF/branch/mouse/YDN_Project/222L_bt_24g/output/flash.dat	(revision 2328)
+++ /YC1308AF/branch/mouse/YDN_Project/222L_bt_24g/output/flash.dat	(working copy)
@@ -2,7 +2,7 @@
 02
 aa
 55
-b6
+ee
 19
 c2
 84
@@ -67,7 +67,7 @@
 c0
 68
 06
-37
+38
 c0
 69
 03
@@ -587,7 +587,7 @@
 70
 8a
 39
-04
+0a
 70
 8a
 3a
@@ -3887,7 +3887,7 @@
 20
 40
 06
-67
+68
 d8
 40
 00
@@ -4107,7 +4107,7 @@
 20
 40
 06
-6a
+6b
 68
 48
 c9
@@ -6363,11 +6363,15 @@
 20
 40
 06
-37
+38
+20
+40
+06
+6e
 20
 20
 41
-1d
+1e
 6f
 e0
 cb
@@ -6383,15 +6387,15 @@
 20
 40
 06
-3e
+3f
 20
 40
 06
-4d
+4e
 20
 40
 06
-5a
+5b
 20
 20
 41
@@ -6403,7 +6407,7 @@
 20
 40
 06
-67
+68
 20
 40
 41
@@ -6423,7 +6427,7 @@
 20
 40
 06
-67
+68
 20
 40
 41
@@ -6443,7 +6447,7 @@
 20
 40
 06
-67
+68
 20
 40
 41
@@ -6487,7 +6491,7 @@
 c0
 7f
 86
-56
+57
 20
 20
 41
@@ -6499,7 +6503,7 @@
 20
 40
 06
-6a
+6b
 68
 48
 c9
@@ -6539,7 +6543,7 @@
 c0
 7f
 86
-63
+64
 20
 20
 41
@@ -6551,7 +6555,7 @@
 20
 40
 06
-6a
+6b
 68
 48
 c9
@@ -6584,8 +6588,60 @@
 20
 61
 2c
-7a
-0b
+70
+4b
+a9
+00
+70
+4b
+aa
+00
+70
+4b
+ab
+00
+1f
+e2
+04
+00
+20
+40
+06
+75
+20
+40
+06
+78
+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
+6f
+ff
 aa
 55
 40
@@ -7966,64 +8022,8 @@
 55
 62
 99
-0a
-ac
-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
+85
+a6
 ff
 ff
 ff
@@ -8188,5 +8188,5 @@
 ff
 ff
 ff
-b5
-fd
+d4
+8d
Index: output/program.lis
===================================================================
--- /YC1308AF/branch/mouse/YDN_Project/222L_bt_24g/output/program.lis	(revision 2328)
+++ /YC1308AF/branch/mouse/YDN_Project/222L_bt_24g/output/program.lis	(working copy)
@@ -15,7 +15,7 @@
 000c c066860b beq patch19_5 ,p_mouse_motion 
 000d c067040b beq patch19_6 ,p_mouse_dpi_process 
 000e c067842c beq patch19_7 ,p_mouse_seting_dpi 
-000f c0680637 beq patch1a_0 ,p_mouse_check_key_gpio 
+000f c0680638 beq patch1a_0 ,p_mouse_check_key_gpio 
 0010 c069038d beq patch1a_2 ,p_mouse_init_sunt 
 0011 c06983a5 beq patch1a_3 ,p_mouse_sensor_poweron 
 0012 c06a84bf beq patch1a_5 ,p_mouse_priority_bb_event 
@@ -183,7 +183,7 @@
 0090 20201226 branch set_rf_ldo_cfg89 
 
 p_set_tx_power_pair:
-0091 708a3904 jam 0x04 ,core_tx_pwr_ctrl0 
+0091 708a390a jam 0x0a ,core_tx_pwr_ctrl0 
 0092 708a3a00 jam 0x00 ,core_tx_pwr_ctrl1 
 0093 20201226 branch set_rf_ldo_cfg89 
 
@@ -1310,7 +1310,7 @@
 03c7 6848c914 fetcht 1 ,mem_matrix_public_gpio 
 03c8 204060e6 call gpio_clr_wake 
 03c9 6fe0c924 fetch 1 ,mem_mouse_sensor_sdio_gpio 
-03ca 20400667 call p_mouse_gpio_config_output_high 
+03ca 20400668 call p_mouse_gpio_config_output_high 
 03cb d8400003 arg 3 ,temp 
 03cc 20403f96 call mouse_gpio_config_input_pu 
 03cd 20403e80 call mouse_lpm_before_common 
@@ -1385,7 +1385,7 @@
 
 p_mouse_3io6key_dpi_check:
 0400 6fe0c913 fetch 1 ,mem_dpi_button_gpio 
-0401 2040066a call p_mouse_gpio_config_output_low 
+0401 2040066b call p_mouse_gpio_config_output_low 
 0402 6848c913 fetcht 1 ,mem_dpi_button_gpio 
 0403 202041d5 branch mouse_3io6key_check 
 
@@ -2153,82 +2153,102 @@
 0634 20204758 branch mouse_drawing_optima 
 
 p_mouse_key:
-0635 20400637 call p_mouse_check_key_gpio 
-0636 2020411d branch mouse_key + 1 
+0635 20400638 call p_mouse_check_key_gpio 
+0636 2040066e call p_mouse_ghost_key_check 
+0637 2020411e branch mouse_key + 2 
 
 p_mouse_check_key_gpio:
-0637 6fe0cbf2 fetch 1 ,mem_sensor_shutdown_flag 
-0638 245a4161 ncall mouse_check_key_gpio_once ,blank 
-0639 da200000 arg 0 ,rega 
-063a 2040063e call p_mouse_check_lkey_gpio 
-063b 2040064d call p_mouse_check_bkkey_gpio 
-063c 2040065a call p_mouse_check_fwkey_gpio 
-063d 2020415e branch mouse_check_key_gpio_next 
+0638 6fe0cbf2 fetch 1 ,mem_sensor_shutdown_flag 
+0639 245a4161 ncall mouse_check_key_gpio_once ,blank 
+063a da200000 arg 0 ,rega 
+063b 2040063f call p_mouse_check_lkey_gpio 
+063c 2040064e call p_mouse_check_bkkey_gpio 
+063d 2040065b call p_mouse_check_fwkey_gpio 
+063e 2020415e branch mouse_check_key_gpio_next 
 
 p_mouse_check_lkey_gpio:
-063e 6fe0c91c fetch 1 ,mem_lbutton_gpio 
-063f 20400667 call p_mouse_gpio_config_output_high 
-0640 20404164 call mouse_check_lkey_gpio 
-0641 6848c91c fetcht 1 ,mem_lbutton_gpio 
-0642 20403f96 call mouse_gpio_config_input_pu 
+063f 6fe0c91c fetch 1 ,mem_lbutton_gpio 
+0640 20400668 call p_mouse_gpio_config_output_high 
+0641 20404164 call mouse_check_lkey_gpio 
+0642 6848c91c fetcht 1 ,mem_lbutton_gpio 
+0643 20403f96 call mouse_gpio_config_input_pu 
 
 p_mouse_check_rkey_gpio:
-0643 6fe0c91d fetch 1 ,mem_rbutton_gpio 
-0644 20400667 call p_mouse_gpio_config_output_high 
-0645 2040416a call mouse_check_rkey_gpio 
-0646 6848c91d fetcht 1 ,mem_rbutton_gpio 
-0647 20403f96 call mouse_gpio_config_input_pu 
+0644 6fe0c91d fetch 1 ,mem_rbutton_gpio 
+0645 20400668 call p_mouse_gpio_config_output_high 
+0646 2040416a call mouse_check_rkey_gpio 
+0647 6848c91d fetcht 1 ,mem_rbutton_gpio 
+0648 20403f96 call mouse_gpio_config_input_pu 
 
 p_mouse_check_mkey_gpio:
-0648 6fe0c91e fetch 1 ,mem_mbutton_gpio 
-0649 20400667 call p_mouse_gpio_config_output_high 
-064a 20404170 call mouse_check_mkey_gpio 
-064b 6848c91e fetcht 1 ,mem_mbutton_gpio 
-064c 20203f96 branch mouse_gpio_config_input_pu 
+0649 6fe0c91e fetch 1 ,mem_mbutton_gpio 
+064a 20400668 call p_mouse_gpio_config_output_high 
+064b 20404170 call mouse_check_mkey_gpio 
+064c 6848c91e fetcht 1 ,mem_mbutton_gpio 
+064d 20203f96 branch mouse_gpio_config_input_pu 
 
 p_mouse_check_bkkey_gpio:
-064d 6fe0c911 fetch 1 ,mem_bk_button_gpio 
-064e c17f8000 rtneq gpio_disable 
-064f 704ba703 jam mouse_bk_key ,mem_mouse_key_temp 
-0650 6fe0cba2 fetch 1 ,mem_mouse_bkkey_press_status 
-0651 1fe22600 copy pdata ,regc 
-0652 6848c911 fetcht 1 ,mem_bk_button_gpio 
-0653 6fe0c914 fetch 1 ,mem_matrix_public_gpio 
-0654 c07f8656 beq gpio_disable ,p_mouse_3io6key_bk_check 
-0655 2020417e branch mouse_check_bkkey_gpio_next 
+064e 6fe0c911 fetch 1 ,mem_bk_button_gpio 
+064f c17f8000 rtneq gpio_disable 
+0650 704ba703 jam mouse_bk_key ,mem_mouse_key_temp 
+0651 6fe0cba2 fetch 1 ,mem_mouse_bkkey_press_status 
+0652 1fe22600 copy pdata ,regc 
+0653 6848c911 fetcht 1 ,mem_bk_button_gpio 
+0654 6fe0c914 fetch 1 ,mem_matrix_public_gpio 
+0655 c07f8657 beq gpio_disable ,p_mouse_3io6key_bk_check 
+0656 2020417e branch mouse_check_bkkey_gpio_next 
 
 p_mouse_3io6key_bk_check:
-0656 6fe0c911 fetch 1 ,mem_bk_button_gpio 
-0657 2040066a call p_mouse_gpio_config_output_low 
-0658 6848c911 fetcht 1 ,mem_bk_button_gpio 
-0659 2020418b branch mouse_3io6key_bk_check 
+0657 6fe0c911 fetch 1 ,mem_bk_button_gpio 
+0658 2040066b call p_mouse_gpio_config_output_low 
+0659 6848c911 fetcht 1 ,mem_bk_button_gpio 
+065a 2020418b branch mouse_3io6key_bk_check 
 
 p_mouse_check_fwkey_gpio:
-065a 6fe0c912 fetch 1 ,mem_fw_button_gpio 
-065b c17f8000 rtneq gpio_disable 
-065c 704ba704 jam mouse_fw_key ,mem_mouse_key_temp 
-065d 6fe0cba3 fetch 1 ,mem_mouse_fwkey_press_status 
-065e 1fe22600 copy pdata ,regc 
-065f 6848c912 fetcht 1 ,mem_fw_button_gpio 
-0660 6fe0c914 fetch 1 ,mem_matrix_public_gpio 
-0661 c07f8663 beq gpio_disable ,p_mouse_3io6key_fw_check 
-0662 20204197 branch mouse_check_fwkey_gpio_next 
+065b 6fe0c912 fetch 1 ,mem_fw_button_gpio 
+065c c17f8000 rtneq gpio_disable 
+065d 704ba704 jam mouse_fw_key ,mem_mouse_key_temp 
+065e 6fe0cba3 fetch 1 ,mem_mouse_fwkey_press_status 
+065f 1fe22600 copy pdata ,regc 
+0660 6848c912 fetcht 1 ,mem_fw_button_gpio 
+0661 6fe0c914 fetch 1 ,mem_matrix_public_gpio 
+0662 c07f8664 beq gpio_disable ,p_mouse_3io6key_fw_check 
+0663 20204197 branch mouse_check_fwkey_gpio_next 
 
 p_mouse_3io6key_fw_check:
-0663 6fe0c912 fetch 1 ,mem_fw_button_gpio 
-0664 2040066a call p_mouse_gpio_config_output_low 
-0665 6848c912 fetcht 1 ,mem_fw_button_gpio 
-0666 202041a4 branch mouse_3io6key_fw_check 
+0664 6fe0c912 fetch 1 ,mem_fw_button_gpio 
+0665 2040066b call p_mouse_gpio_config_output_low 
+0666 6848c912 fetcht 1 ,mem_fw_button_gpio 
+0667 202041a4 branch mouse_3io6key_fw_check 
 
 p_mouse_gpio_config_output_high:
-0667 c17f8000 rtneq gpio_disable 
-0668 d840003f arg gpcfg_output_high ,temp 
-0669 2020612c branch gpio_config_function_int 
+0668 c17f8000 rtneq gpio_disable 
+0669 d840003f arg gpcfg_output_high ,temp 
+066a 2020612c branch gpio_config_function_int 
 
 p_mouse_gpio_config_output_low:
-066a c17f8000 rtneq gpio_disable 
-066b d840003e arg gpcfg_output_low ,temp 
-066c 2020612c branch gpio_config_function_int 
+066b c17f8000 rtneq gpio_disable 
+066c d840003e arg gpcfg_output_low ,temp 
+066d 2020612c branch gpio_config_function_int 
+
+p_mouse_ghost_key_check:
+066e 704ba900 jam 0 ,mem_mouse_matrix_key_cow_count 
+066f 704baa00 jam 0 ,mem_mouse_matrix_key_row_count 
+0670 704bab00 jam 0 ,mem_mouse_ghost_flag 
+0671 1fe20400 copy pdata ,temp 
+0672 20400675 call p_mouse_ghost_key_check_l_fw 
+0673 20400678 call p_mouse_ghost_key_check_r_bk 
+0674 20204133 branch mouse_ghost_key_check + 6 
+
+p_mouse_ghost_key_check_l_fw:
+0675 18417e11 and temp ,mouse_l_fw_button ,pdata 
+0676 c008c14e beq mouse_l_fw_button ,mouse_matrix_cow_more_than_one_key 
+0677 20600000 rtn 
+
+p_mouse_ghost_key_check_r_bk:
+0678 18417e0a and temp ,mouse_r_bk_button ,pdata 
+0679 c005414e beq mouse_r_bk_button ,mouse_matrix_cow_more_than_one_key 
+067a 20600000 rtn 
               org 0x800
 
 start:
Index: output/ramcode.rom
===================================================================
--- /YC1308AF/branch/mouse/YDN_Project/222L_bt_24g/output/ramcode.rom	(revision 2328)
+++ /YC1308AF/branch/mouse/YDN_Project/222L_bt_24g/output/ramcode.rom	(working copy)
@@ -13,7 +13,7 @@
 c066860b
 c067040b
 c067842c
-c0680637
+c0680638
 c069038d
 c06983a5
 c06a84bf
@@ -143,7 +143,7 @@
 708a390a
 708a3a00
 20201226
-708a3904
+708a390a
 708a3a00
 20201226
 20406e5e
@@ -968,7 +968,7 @@
 6848c914
 204060e6
 6fe0c924
-20400667
+20400668
 d8400003
 20403f96
 20403e80
@@ -1023,7 +1023,7 @@
 c07f8400
 2020407f
 6fe0c913
-2040066a
+2040066b
 6848c913
 202041d5
 18427e00
@@ -1587,27 +1587,28 @@
 6fe0c92c
 c1018000
 20204758
-20400637
-2020411d
+20400638
+2040066e
+2020411e
 6fe0cbf2
 245a4161
 da200000
-2040063e
-2040064d
-2040065a
+2040063f
+2040064e
+2040065b
 2020415e
 6fe0c91c
-20400667
+20400668
 20404164
 6848c91c
 20403f96
 6fe0c91d
-20400667
+20400668
 2040416a
 6848c91d
 20403f96
 6fe0c91e
-20400667
+20400668
 20404170
 6848c91e
 20203f96
@@ -1618,10 +1619,10 @@
 1fe22600
 6848c911
 6fe0c914
-c07f8656
+c07f8657
 2020417e
 6fe0c911
-2040066a
+2040066b
 6848c911
 2020418b
 6fe0c912
@@ -1631,10 +1632,10 @@
 1fe22600
 6848c912
 6fe0c914
-c07f8663
+c07f8664
 20204197
 6fe0c912
-2040066a
+2040066b
 6848c912
 202041a4
 c17f8000
@@ -1643,3 +1644,16 @@
 c17f8000
 d840003e
 2020612c
+704ba900
+704baa00
+704bab00
+1fe20400
+20400675
+20400678
+20204133
+18417e11
+c008c14e
+20600000
+18417e0a
+c005414e
+20600000
Index: program/patch.prog
===================================================================
--- /YC1308AF/branch/mouse/YDN_Project/222L_bt_24g/program/patch.prog	(revision 2328)
+++ /YC1308AF/branch/mouse/YDN_Project/222L_bt_24g/program/patch.prog	(working copy)
@@ -212,7 +212,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
 
@@ -2740,7 +2740,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
@@ -2819,6 +2820,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
