catch a function call

This is the place for queries that don't fit in any of the other categories.

catch a function call

Postby 3t3r4n » Mon Aug 12, 2013 5:18 pm

How can i catch a function call?
Code: Select all
class GameWindow():
   def OnKeyUp(self, key):
Code: Select all
import game
   def bypass(self,key):
      do something

When OnKeyUp is called i want to automaticaly call bypass function without modify ... how can i do this? Something like detours in C++
I've donne this last year but i don't know how :( i don't remember ... it was a function to connect this 2 functions
Posts: 1
Joined: Mon Aug 12, 2013 5:07 pm

Re: catch a function call

Postby micseydel » Mon Aug 12, 2013 7:56 pm

I don't think you can do what you're describing, but you could get that behavior by inheriting from GameWindow, overriding the OnKeyUp method to have it call your desired function and then call the superclass' one.
Due to the reasons discussed here we will be moving to on October 1, 2016.

This forum will be locked down and no one will be able to post/edit/create threads, etc. here from thereafter. Please create an account at the new site to continue discussion.
User avatar
Posts: 3000
Joined: Tue Feb 12, 2013 2:18 am
Location: Mountain View, CA

Return to General Coding Help

Who is online

Users browsing this forum: No registered users and 12 guests