Responsa for Shabbat 115:18
אמר מר לא תצא בהמה לא בחותם שבצוארה ולא בחותם שבכסותה ולא בזוג שבצוארה ולא בזוג שבכסותה זה וזה אין מקבלין טומאה
The Master said: '[He may] not [go out] with the bell around his neck, but he may go out with the bell on his garment.' Why not with the bell around his neck; [presumably] 'lest it snap off and he come to carry it: then also in the case of the bell on his garment let us fear that it may snap off and he come to carry it? — The reference here is to one that was woven [sewn] into it. And [this is] in agreement with R. Huna the son of R. Joshua, who said: Concerning whatever is woven they enacted no prohibition.<span class="x" onmousemove="('comment',' I.e., if something is woven into a garment, it may be worn on the Sabbath without fear of its falling off. V. supra 57b. ');"><sup>17</sup></span>
Teshuvot Maharam
A. People do not usually wear metal keys on their girdles as ornaments. Therefore, this key is not considered an ornament and he is not permitted to wear it on the Sabbath.
SOURCES: Pr. 532; Mord. Shabb. 350; Hag. Maim. to Shabbat, 19, 4. Cf. Maharil, Responsa 84.