{"id":3523,"date":"2022-08-26T10:35:32","date_gmt":"2022-08-26T01:35:32","guid":{"rendered":"https:\/\/oohito.com\/nqthm\/?p=3523"},"modified":"2022-08-26T11:26:43","modified_gmt":"2022-08-26T02:26:43","slug":"pharo-%e3%81%a7%e6%97%a5%e6%9c%ac%e8%aa%9e%e5%85%a5%e5%8a%9b%e3%81%99%e3%82%8b%e3%81%a8%e6%9c%80%e5%88%9d%e3%81%ae%ef%bc%91%e6%96%87%e5%ad%97%e3%81%97%e3%81%8b%e5%85%a5%e5%8a%9b%e3%81%95%e3%82%8c","status":"publish","type":"post","link":"https:\/\/oohito.com\/nqthm\/archives\/3523","title":{"rendered":"Pharo \u3067\u65e5\u672c\u8a9e\u5165\u529b\u3059\u308b\u3068\u6700\u521d\u306e\uff11\u6587\u5b57\u3057\u304b\u5165\u529b\u3055\u308c\u306a\u3044\u4ef6"},"content":{"rendered":"\n<p>Pharo \u3067\u65e5\u672c\u8a9e\u306e\u6587\u7ae0\u3092\u30a4\u30f3\u30e9\u30a4\u30f3\u5165\u529b\u3057\u3066\u3082\u5165\u529b\u4e2d\u306f\u4f55\u3082\u8868\u793a\u3055\u308c\u306a\u3044\u3002Enter \u3067\u78ba\u5b9a\u3059\u308b\u3068\u306a\u305c\u304b\u6700\u521d\u306e\uff11\u6587\u5b57\u3060\u3051\u304c\u5165\u529b\u3055\u308c\u308b\u3002\uff08\u305f\u3068\u3048\u3070\u3001\u300c\u3042\u3044\u3046\u3048\u304a\u300d+Enter \u3068\u5165\u529b\u3059\u308b\u3068\u300c\u3042\u300d\u3060\u3051\u8868\u793a\u3055\u308c\u308b\uff09<\/p>\n\n\n\n<p>\u30a4\u30f3\u30e9\u30a4\u30f3\u5165\u529b\u306b\u5bfe\u5fdc\u3057\u3066\u3044\u306a\u3044\u306e\u306f\u8ae6\u3081\u308b\u3068\u3057\u3066\u3082\u3001\uff11\u6587\u5b57\u3057\u304b\u5165\u529b\u3055\u308c\u306a\u3044\u306e\u306f\u3068\u3066\u3082\u4e0d\u4fbf\u3067\u3042\u308b\u3002<\/p>\n\n\n\n<!--more-->\n\n\n\n<p>\u3053\u308c\u306f\u3001OSWindowMorphicEventHandler&gt;&gt;#visitTextInputEvent: \u3067\u3001OS\u304b\u3089\u53d7\u3051\u53d6\u3063\u305f\u30c6\u30ad\u30b9\u30c8\u306e\u5148\u982d\u6587\u5b57\u3057\u304b\u30ad\u30fc\u30a4\u30d9\u30f3\u30c8\u3092\u751f\u6210\u3057\u3066\u3044\u306a\u3044\u305b\u3044\u3060\u3063\u305f\u3002\uff08\u4e0b\u8a18\u592a\u5b57\u90e8\u5206\uff09<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>visitTextInputEvent: anEvent\n    | keyEvent char mods |\n    anEvent text ifNil: &#91; ^ nil ].\n    <strong>char := anEvent text first.<\/strong>\n    char ifNil: &#91; ^ nil ].\n    mods := anEvent modifiers.\n    \"If a modifier key is pressed the keystroke event is handled by #visitMouseDownEvent:\"\n    (mods alt or: &#91; mods ctrl or: &#91; mods cmd ] ])\n        ifTrue: &#91; ^ nil ].\n        \n    keyEvent := KeyboardEvent new\n        setType: #keystroke\n        buttons: (self convertModifiers: anEvent modifiers)\n        position: (self convertPosition: anEvent position)\n        keyValue: char charCode\n        charCode: char charCode\n        hand: self activeHand\n        stamp: Time millisecondClockValue.\n    \n    ^ keyEvent<\/code><\/pre>\n\n\n\n<p>anEvent text \u306b\u306f\u3001\u3061\u3083\u3093\u3068\u5165\u529b\u30c6\u30ad\u30b9\u30c8\u304c\u5165\u3063\u3066\u304f\u308b\u3093\u3060\u3051\u3069\u3001first \u3067\u5148\u982d\u6587\u5b57\u3060\u3051\u3092 KeyboardEvent \u306b\u3057\u3066\u3044\u308b\u306e\u304c\u539f\u56e0\u3002<\/p>\n\n\n\n<p>\u306f\u3066\u3001\u3053\u308c\u3092\u3069\u3046\u4fee\u6b63\u3057\u305f\u3082\u306e\u304b\u3002<\/p>\n\n\n\n<p>\u3053\u306e\u30e1\u30bd\u30c3\u30c9\u306b\u6e21\u3055\u308c\u308b\u30a4\u30d9\u30f3\u30c8\u306f\u3001 OSTextInputEvent \u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3067\u3001\u3053\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u751f\u6210\u3057\u3066\u3044\u308b\u306e\u306f OSSDL2BackendWindow&gt;&gt;#visitTextInputEvent: \u3060\u3051\u3060\u3063\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>visitTextInputEvent: event\n    | osEvent |\n    \n    osEvent := OSTextInputEvent for: osWindow.\n    osEvent text: (ZnUTF8Encoder new decodeBytes: event text);\n            position: self mousePosition.\n    ^ osEvent deliver<\/code><\/pre>\n\n\n\n<p>\u8a73\u3057\u304f\u8abf\u3079\u3066\u3044\u306a\u3044\u306e\u3067\u3088\u304f\u308f\u304b\u3089\u306a\u3044\u304c\u3001osEvent deliver \u3067\u751f\u6210\u3057\u305f\u30a4\u30d9\u30f3\u30c8\u3092\u5f15\u304d\u6e21\u3057\u3066\u3044\u308b\u3088\u3046\u3060\u3063\u305f\u306e\u3067\u3001\u6587\u5b57\u3054\u3068\u306b\u5206\u89e3\u3057\u3066\u6587\u5b57\u5217\u5206\u3060\u3051\u9001\u308b\u3088\u3046\u306b\u76f4\u3057\u3066\u307f\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>visitTextInputEvent: event\n\n    | osEvent text last |\n    text := ZnUTF8Encoder new decodeBytes: event text.\n    text do: &#91; :each | \n        last := each.\n        osEvent := OSTextInputEvent for: osWindow.\n        osEvent\n            text: each asString;\n            position: self mousePosition.\n        osEvent deliver ].\n    ^ last<\/code><\/pre>\n\n\n\n<p>\u3068\u308a\u3042\u3048\u305a\u78ba\u5b9a\u6587\u5b57\u5217\u304c\u5168\u3066\u5165\u529b\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u3063\u305f\u3002\u4ed6\u306b\u60aa\u5f71\u97ff\u304c\u51fa\u308b\u306e\u304b\u3069\u3046\u304b\u306f\u308f\u304b\u3089\u306a\u3044\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pharo \u3067\u65e5\u672c\u8a9e\u306e\u6587\u7ae0\u3092\u30a4\u30f3\u30e9\u30a4\u30f3\u5165\u529b\u3057\u3066\u3082\u5165\u529b\u4e2d\u306f\u4f55\u3082\u8868\u793a\u3055\u308c\u306a\u3044\u3002Enter \u3067\u78ba\u5b9a\u3059\u308b\u3068\u306a\u305c\u304b\u6700\u521d\u306e\uff11\u6587\u5b57\u3060\u3051\u304c\u5165\u529b\u3055\u308c\u308b\u3002\uff08\u305f\u3068\u3048\u3070\u3001\u300c\u3042\u3044\u3046\u3048\u304a\u300d+Enter \u3068\u5165\u529b\u3059\u308b\u3068\u300c\u3042\u300d\u3060\u3051\u8868\u793a\u3055\u308c\u308b\uff09 \u30a4\u30f3\u30e9\u30a4\u30f3&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[38],"tags":[],"class_list":["post-3523","post","type-post","status-publish","format-standard","hentry","category-pharo"],"_links":{"self":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts\/3523","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/comments?post=3523"}],"version-history":[{"count":9,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts\/3523\/revisions"}],"predecessor-version":[{"id":3534,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts\/3523\/revisions\/3534"}],"wp:attachment":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/media?parent=3523"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/categories?post=3523"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/tags?post=3523"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}