Update of /cvsroot/freevo/freevo/src
In directory sc8-pr-cvs1:/tmp/cvs-serv31973
Modified Files:
rc.py
Log Message:
Patch from Soenke Schwardt to use the time to fix repeat problems with
some remote receiver.
Index: rc.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/rc.py,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** rc.py 18 Oct 2003 21:23:38 -0000 1.25
--- rc.py 26 Oct 2003 17:04:26 -0000 1.26
***************
*** 10,13 ****
--- 10,17 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.26 2003/10/26 17:04:26 dischi
+ # Patch from Soenke Schwardt to use the time to fix repeat problems with
+ # some remote receiver.
+ #
# Revision 1.25 2003/10/18 21:23:38 rshortt
# Added a subscribe method so that you can get a callback when events are
***************
*** 52,55 ****
--- 56,60 ----
from event import Event, BUTTON
import osd
+ import time
PYLIRC = 1
***************
*** 140,152 ****
self.repeat_count = 0
self.event_callback = None
!
! # Take into consideration only 1 event out of ``modulo''
! self.default_repeat_modulo = 4 # Config
!
! # After how many repeats do we decrease the modulo?
! self.repeat_modulo_decrease_threshhold = 5 # Config
!
! self.repeat_modulo = self.default_repeat_modulo
!
def set_app(self, app, context):
--- 145,153 ----
self.repeat_count = 0
self.event_callback = None
! self.firstkeystroke = 0.0
! self.lastkeystroke = 0.0
! self.lastkeycode = ''
! self.default_keystroke_delay1 = 0.25 # Config
! self.default_keystroke_delay2 = 0.25 # Config
def set_app(self, app, context):
***************
*** 220,234 ****
if self.pylirc:
list, flag = self.get_last_code()
- if flag == 1:
- self.repeat_count = 0
- self.repeat_modulo = self.default_repeat_modulo
if list != None:
! if self.repeat_count > self.repeat_modulo_decrease_threshhold * \
! (self.default_repeat_modulo - self.repeat_modulo + 1) \
! and self.repeat_modulo > 1:
! self.repeat_modulo -= 1
! if self.repeat_count % self.repeat_modulo != 0:
! list = []
self.repeat_count += 1
--- 221,254 ----
if self.pylirc:
list, flag = self.get_last_code()
+ if list == None:
+ nowtime = 0.0
+ nowtime = time.time()
+ if (self.lastkeystroke + self.default_keystroke_delay2 < nowtime)
and (self.firstkeystroke != 0.0):
+ self.firstkeystroke = 0.0
+ self.lastkeystroke = 0.0
+ self.repeat_count = 0
+
if list != None:
!
! nowtime = time.time()
!
! if (list != None) and (list != []):
! for code in list:
! if ( self.lastkeycode != code ):
! self.lastkeycode = code
! self.lastkeystroke = nowtime
! self.firstkeystoke = nowtime
!
! if self.firstkeystroke == 0.0 :
! self.firstkeystroke = time.time()
! else:
! if (self.firstkeystroke + self.default_keystroke_delay1 >
nowtime):
! list = []
! else:
! if (self.lastkeystroke + self.default_keystroke_delay2 <
nowtime):
! self.firstkeystroke = nowtime
!
! self.lastkeystroke = nowtime
self.repeat_count += 1
-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community? Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog