You guessed about 50% of their history, and 50% is wrong
Yes, Egypt was turkic before. Turks invaded Egypt instead Asia Minor
Then, Crusaders and Romans reconquested Palestine, Lebanon, Nile Delta etc
Then Egyptian Copts drive turks out, to Sudan
Also, Mamluks never ruled Egypt, and Egypt has...