@@ -17,6 +17,7 @@ use awase::types::{RawKeyEvent, VkCode};
1717
1818use crate :: hook:: CallbackResult ;
1919use crate :: platform:: WindowsPlatform ;
20+ use crate :: runtime:: PhysicalKeyDisposition ;
2021use crate :: state:: platform_state:: ImeStateHub ;
2122use crate :: vk:: VkCodeExt ;
2223use crate :: RawKeyEventExt as _;
@@ -93,11 +94,12 @@ impl DecisionExecutor {
9394 ime : & ImeStateHub ,
9495 decision : Decision ,
9596 raw_event : & RawKeyEvent ,
97+ physical : PhysicalKeyDisposition ,
9698 ) -> BatchResult {
9799 self . applied_snapshot = ime. model ( ) . applied ;
98100 match self . hook_mode {
99- HookMode :: Filter => self . execute_filter ( platform, decision) ,
100- HookMode :: Relay => self . execute_relay ( platform, decision, raw_event) ,
101+ HookMode :: Filter => self . execute_filter ( platform, decision, physical ) ,
102+ HookMode :: Relay => self . execute_relay ( platform, decision, raw_event, physical ) ,
101103 }
102104 }
103105
@@ -255,17 +257,18 @@ impl DecisionExecutor {
255257 & mut self ,
256258 platform : & mut WindowsPlatform ,
257259 decision : Decision ,
260+ physical : PhysicalKeyDisposition ,
258261 ) -> BatchResult {
259- let ( consumed , effects) = match decision {
262+ let ( callback , effects) = match decision {
260263 Decision :: PassThrough => {
261264 return BatchResult {
262- callback : CallbackResult :: PassThrough ,
265+ callback : physical . to_callback ( false ) ,
263266 has_pending : self . has_pending ( ) ,
264267 sync_outcomes : Vec :: new ( ) ,
265268 }
266269 }
267- Decision :: PassThroughWith { effects } => ( false , effects) ,
268- Decision :: Consume { effects } => ( true , effects) ,
270+ Decision :: PassThroughWith { effects } => ( physical . to_callback ( false ) , effects) ,
271+ Decision :: Consume { effects } => ( physical . to_callback ( true ) , effects) ,
269272 } ;
270273
271274 let mut sync_outcomes = Vec :: new ( ) ;
@@ -281,11 +284,7 @@ impl DecisionExecutor {
281284 }
282285
283286 BatchResult {
284- callback : if consumed {
285- CallbackResult :: Consumed
286- } else {
287- CallbackResult :: PassThrough
288- } ,
287+ callback,
289288 has_pending : self . has_pending ( ) ,
290289 sync_outcomes,
291290 }
@@ -306,9 +305,19 @@ impl DecisionExecutor {
306305 platform : & mut WindowsPlatform ,
307306 decision : Decision ,
308307 raw_event : & RawKeyEvent ,
308+ physical : PhysicalKeyDisposition ,
309309 ) -> BatchResult {
310310 match decision {
311311 Decision :: PassThrough => {
312+ // physical=Suppress(KANJI 物理キー抑止)の場合は OS に届けず Consume する。
313+ // handle_passthrough の reinject/warmup 後処理も走らせない。
314+ if physical == PhysicalKeyDisposition :: Suppress {
315+ return BatchResult {
316+ has_pending : self . has_pending ( ) ,
317+ callback : CallbackResult :: Consumed ,
318+ sync_outcomes : Vec :: new ( ) ,
319+ } ;
320+ }
312321 let callback = self . handle_passthrough ( platform, raw_event) ;
313322 BatchResult {
314323 has_pending : self . has_pending ( ) ,
@@ -317,17 +326,22 @@ impl DecisionExecutor {
317326 }
318327 }
319328 Decision :: PassThroughWith { mut effects } => {
320- // flush 出力あり → Consume して flush + キー再注入を FIFO でキュー
329+ // flush 出力あり → Consume して flush + キー再注入を FIFO でキュー。
330+ // physical=Suppress(KANJI 物理キー抑止)の場合は reinject を積まない。
331+ let reinject = physical == PhysicalKeyDisposition :: Allow ;
321332 log:: debug!(
322- "[relay-flush] PassThroughWith: queue {} effect(s) + reinject (vk={:#04x} {})" ,
333+ "[relay-flush] PassThroughWith: queue {} effect(s){} (vk={:#04x} {})" ,
323334 effects. len( ) ,
335+ if reinject { " + reinject" } else { " (no reinject, suppressed)" } ,
324336 raw_event. vk_code,
325337 match raw_event. event_type {
326338 awase:: types:: KeyEventType :: KeyDown => "down" ,
327339 awase:: types:: KeyEventType :: KeyUp => "up" ,
328340 } ,
329341 ) ;
330- effects. push ( Effect :: Input ( InputEffect :: ReinjectKey ( * raw_event) ) ) ;
342+ if reinject {
343+ effects. push ( Effect :: Input ( InputEffect :: ReinjectKey ( * raw_event) ) ) ;
344+ }
331345 self . queue . extend ( effects) ;
332346 BatchResult {
333347 callback : CallbackResult :: Consumed ,
0 commit comments